在虚拟机中模拟为CentOS系统添加硬盘


操作环境: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.   
  22.   
  23. The number of cylinders for this disk is set to 1044.  
  24. There is nothing wrong with that, but this is larger than 1024,  
  25. and could in certain setups cause problems with:  
  26. 1) software that runs at boot time (e.g., old versions of LILO)  
  27. 2) booting and partitioning software from other OSs  
  28.    (e.g., DOS FDISK, OS/2 FDISK)  
  29. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)  
  30.   
  31. Command (m for help): m  
  32. Command action  
  33.    a   toggle a bootable flag  
  34.    b   edit bsd disklabel  
  35.    c   toggle the dos compatibility flag  
  36.    d   delete a partition  
  37.    l   list known partition types  
  38.    m   print this menu  
  39.    n   add a new partition  
  40.    o   create a new empty DOS partition table  
  41.    p   print the partition table  
  42.    q   quit without saving changes  
  43.    s   create a new empty Sun disklabel  
  44.    t   change a partition's system id  
  45.    u   change display/entry units  
  46.    v   verify the partition table  
  47.    w   write table to disk and exit  
  48.    x   extra functionality (experts only)  
  49.   
  50. Command (m for help): p  
  51.   
  52. Disk /dev/sdb: 8589 MB, 8589934592 bytes  
  53. 255 heads, 63 sectors/track, 1044 cylinders  
  54. Units = cylinders of 16065 * 512 = 8225280 bytes  
  55.   
  56.    Device Boot      Start         End      Blocks   Id  System  
  57.   
  58. Command (m for help): n  
  59. Command action  
  60.    e   extended  
  61.    p   primary partition (1-4)  
  62. p  
  63. Partition number (1-4): 1  
  64. First cylinder (1-1044, default 1): 1  
  65. Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): 1044  
  66.   
  67. Command (m for help): p  
  68.   
  69. Disk /dev/sdb: 8589 MB, 8589934592 bytes  
  70. 255 heads, 63 sectors/track, 1044 cylinders  
  71. Units = cylinders of 16065 * 512 = 8225280 bytes  
  72.   
  73.    Device Boot      Start         End      Blocks   Id  System  
  74. /dev/sdb1               1        1044     8385898+  83  Linux  
  75.   
  76. Command (m for help): m  
  77. Command action  
  78.    a   toggle a bootable flag  
  79.    b   edit bsd disklabel  
  80.    c   toggle the dos compatibility flag  
  81.    d   delete a partition  
  82.    l   list known partition types  
  83.    m   print this menu  
  84.    n   add a new partition  
  85.    o   create a new empty DOS partition table  
  86.    p   print the partition table  
  87.    q   quit without saving changes  
  88.    s   create a new empty Sun disklabel  
  89.    t   change a partition's system id  
  90.    u   change display/entry units  
  91.    v   verify the partition table  
  92.    w   write table to disk and exit  
  93.    x   extra functionality (experts only)  
  94.   
  95. Command (m for help): w  
  96. The partition table has been altered!  
  97.   
  98. Calling ioctl() to re-read partition table.  
  99. Syncing disks.  
  100. [root@oracle11gR2 dev]#   
  • 1
  • 2
  • 下一页

相关内容