歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 在虛擬機中模擬為CentOS系統添加硬盤

在虛擬機中模擬為CentOS系統添加硬盤

日期:2017/2/28 15:57:42   编辑:Linux教程

操作環境:VMware+CentOS5.0

實驗目的:為CentOS5.0系統添加一塊新磁盤,並mount到md目錄下

實驗過程:

步驟1:從VMare虛擬添加一塊8G的磁盤

菜單中選擇VM-->Settings,出現如下對話框(也可雙擊device界面)


按照提示做如下操作:選擇Add---> Hard Disk--->Create a new virtual disk---->next---->select a type(scsi)--->capity--->ok

第二步:啟動虛擬機,在Unix系統中添加磁盤,並劃分為一個分區

[plain]
  1. [root@Oracle11gR2 ~]# cd /dev/
  2. [root@oracle11gR2 dev]# ls
  3. adsp fd0 fd0u820 loop1 mixer pts ram5 sdb tty0 tty20 tty32 tty44 tty56 ttyS1 vcs5
  4. agpgart fd0u1040 fd0u830 loop2 net ram ram6 sequencer tty1 tty21 tty33 tty45 tty57 ttyS2 vcs6
  5. audio fd0u1120 floppy loop3 null ram0 ram7 sequencer2 tty10 tty22 tty34 tty46 tty58 ttyS3 vcsa
  6. autofs fd0u1440 floppy-fd0 loop4 nvram ram1 ram8 sg0 tty11 tty23 tty35 tty47 tty59 urandom vcsa1
  7. bus fd0u1680 full loop5 oldmem ram10 ram9 sg1 tty12 tty24 tty36 tty48 tty6 usbdev1.1_ep00 vcsa2
  8. cdrom fd0u1722 gpmctl loop6 par0 ram11 ramdisk shm tty13 tty25 tty37 tty49 tty60 usbdev1.1_ep81 vcsa3
  9. cdrom-hdc fd0u1743 hdc loop7 parport0 ram12 random snapshot tty14 tty26 tty38 tty5 tty61 usbdev1.2_ep00 vcsa4
  10. console fd0u1760 hpet lp0 parport1 ram13 rawctl snd tty15 tty27 tty39 tty50 tty62 usbdev1.2_ep81 vcsa5
  11. core fd0u1840 initctl MAKEDEV parport2 ram14 root stderr tty16 tty28 tty4 tty51 tty63 vcs vcsa6
  12. disk fd0u1920 input mapper parport3 ram15 rtc stdin tty17 tty29 tty40 tty52 tty7 vcs1 X0R
  13. dmmidi fd0u360 kmsg md0 port ram2 sda stdout tty18 tty3 tty41 tty53 tty8 vcs2 zero
  14. dsp fd0u720 log mem ppp ram3 sda1 systty tty19 tty30 tty42 tty54 tty9 vcs3
  15. fd fd0u800 loop0 midi ptmx ram4 sda2 tty tty2 tty31 tty43 tty55 ttyS0 vcs4
  16. [root@oracle11gR2 dev]# fdisk /dev/sdb
  17. Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
  18. Building a new DOS disklabel. Changes will remain in memory only,
  19. until you decide to write them. After that, of course, the previous
  20. content won't be recoverable.
  21. The number of cylinders for this disk is set to 1044.
  22. There is nothing wrong with that, but this is larger than 1024,
  23. and could in certain setups cause problems with:
  24. 1) software that runs at boot time (e.g., old versions of LILO)
  25. 2) booting and partitioning software from other OSs
  26. (e.g., DOS FDISK, OS/2 FDISK)
  27. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
  28. Command (m for help): m
  29. Command action
  30. a toggle a bootable flag
  31. b edit bsd disklabel
  32. c toggle the dos compatibility flag
  33. d delete a partition
  34. l list known partition types
  35. m print this menu
  36. n add a new partition
  37. o create a new empty DOS partition table
  38. p print the partition table
  39. q quit without saving changes
  40. s create a new empty Sun disklabel
  41. t change a partition's system id
  42. u change display/entry units
  43. v verify the partition table
  44. w write table to disk and exit
  45. x extra functionality (experts only)
  46. Command (m for help): p
  47. Disk /dev/sdb: 8589 MB, 8589934592 bytes
  48. 255 heads, 63 sectors/track, 1044 cylinders
  49. Units = cylinders of 16065 * 512 = 8225280 bytes
  50. Device Boot Start End Blocks Id System
  51. Command (m for help): n
  52. Command action
  53. e extended
  54. p primary partition (1-4)
  55. p
  56. Partition number (1-4): 1
  57. First cylinder (1-1044, default 1): 1
  58. Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): 1044
  59. Command (m for help): p
  60. Disk /dev/sdb: 8589 MB, 8589934592 bytes
  61. 255 heads, 63 sectors/track, 1044 cylinders
  62. Units = cylinders of 16065 * 512 = 8225280 bytes
  63. Device Boot Start End Blocks Id System
  64. /dev/sdb1 1 1044 8385898+ 83 Linux
  65. Command (m for help): m
  66. Command action
  67. a toggle a bootable flag
  68. b edit bsd disklabel
  69. c toggle the dos compatibility flag
  70. d delete a partition
  71. l list known partition types
  72. m print this menu
  73. n add a new partition
  74. o create a new empty DOS partition table
  75. p print the partition table
  76. q quit without saving changes
  77. s create a new empty Sun disklabel
  78. t change a partition's system id
  79. u change display/entry units
  80. v verify the partition table
  81. w write table to disk and exit
  82. x extra functionality (experts only)
  83. Command (m for help): w
  84. The partition table has been altered!
  85. Calling ioctl() to re-read partition table.
  86. Syncing disks.
  87. [root@oracle11gR2 dev]#
Copyright © Linux教程網 All Rights Reserved