How to add Ubuntu hard disks for virtual machines
1. first, shut down ubuntu. </P> <p> 2. in VMware, choose VM --> Settings </P> <p> 3. click Add in hardware and select hard disk --> next --> disk size (GB) is the size of the new hard disk --> next --> finish --> OK. in this way, a hard disk 2 is added to the devices of VMware. </P> <p> 3. Go to Ubuntu and mount the new hard disk. </P> <p> 1. </P> <p> root @ sparkle-desktop :~ # Fdisk-L </P> <p> Disk/dev/SDA: 17.1 GB, 17179869184 bytes </P> <p> 255 heads, 63 sectors/track, 2088 cylinders </P> <p> Units = cylinders of 16065*512 = 8225280 bytes </P> <p> disk identifier: 0x000af2a2 </P> <p> device boot start end blocks ID system </P> <p>/dev/sda1*1 993 7976241 83 Linux </P> <p>/ dev/sda2 994 1044 409657 + 5 Extended </P> <p>/dev/sda5 994 1044 409626 82 Linux swap/Solaris </P> <p> Di SK/dev/SDB: 8589 MB, 8589934592 bytes </P> <p> 255 heads, 63 sectors/track, 1044 cylinders </P> <p> Units = cylinders of 16065*512 = 8225280 bytes </P> <p> disk identifier: 0x00000000 </P> <p> Disk/dev/SDB doesn't contain a valid Partition Table </P> <p> one more/dev/SDB is displayed. </P> <p> 2. </P> <p> The following is the file system formatted as ext3 </P> <p> root @ sparkle-desktop :~ # Mkfs-T ext3/dev/SDB </P> <p> mke2fs 1.40.8 (13-Mar-2008) </P> <p>/dev/SDB is entire device, not just one partition! </P> <p> proceed anyway? (Y, n) y // format the entire new hardware without partitioning. </P> <p> filesystem label = </P> <p> OS type: Linux </P> <p> block size = 4096 (log = 2) </P> <p> fragment size = 4096 (log = 2) </P> <p> 524288 inodes, 2097152 blocks </P> <p> 104857 blocks (5.00%) reserved for the Super User </P> <p> first data block = 0 </P> <p> maximum filesystem blocks = 2147483648 </P> <p> 64 block groups </P> <p> 32768 blocks per group, 32768 fragments per group </P> <p> 8192 inodes per group </P> <p> superblo CK backups stored on blocks: </P> <p> 32768,983 04, 163840,229 376, 294912,819 200, 884736,160 5632 </P> <p> writing inode tables: done </P> <p> creating Journal (32768 blocks): Done </P> <p> writing superblocks and filesystem accounting information: done </P> <p> This filesystem will be automatically checked every 26 mounts or </P> <p> 180 days, whichever comes first. use tune2fs-C or-I to override. </P> <p> Root @ sparkle-desktop :~ # </P> <p> 3. </P> <p> root @ sparkle-desktop :~ # Cd/home </P> <p> root @ sparkle-desktop:/home # mkdir Work </P> <p> root @ sparkle-desktop: /home # Mount/dev/SDB work // mount the hard disk to the work directory. </P> <p> root @ sparkle-desktop:/home # CD work </P> <p> root @ sparkle-desktop: /home/work # ls </P> <p> lost + found </P> <p> 4. </P> <p> run the DF command to check the mounting status. </P> <p> root @ sparkle-desktop :~ # DF </P> <p> filesystem 1k-blocks used available use % mounted on </P> <p>/dev/sda1 7913216 7803524 0 100%/</P> <p> varrun 257788 240 257548 1%/var/run </P> <p> Varlock 257788 0 257788 0%/var/lock </P> <p> udev 257788 48 257740 1%/dev </P> <p> devshm 257788 44 257744 1%/dev/SHM </P> <p> lrm 257788 39760 218028 16%/lib/modules/2.6.24-19-generic/volatile </P> <p>/dev/SDB 8322488 149632 7753428 2%/home/work </P> <p> gvfs-fuse-daemon 7913216 7803524 100% 0/root /. gvfs </P> <p> you can see/dev/SDB 8322488 149632 7753428 2%/home/Work </P> <p>. </P> <p> 5. Enable automatic mounting. </P> <p> root @ sparkle-desktop :~ # Gedit/etc/fstab </P> <p> according to the following format </P> <p> # <file system> <mount point> <type> <Options> <dump> <pass> </P> <p> Add: </P> <p>/dev/sdb/home/work ext3 defaults 0 0 <br/>