A preface: We just started to install Ubuntu on the virtual machine, always reluctant to allocate too much hard disk space. But it's not enough to use the hard drive for a long time. One of the stupidest ways to do this is to reload the system, but it's time-consuming. It would be nice if you could add the hard drive without reloading the system. Here's how to implement it.
Two.
1. First put Ubuntu shutdown.
2. Click on the menu in VMware vm-->settings
3. In hardware, click the Add button below and choose hard disk-->next-->next-->disk size (GB) is the size of the new drive-->next-->finish--> Ok. This will have a hard Disk 2 in VMware's devices.
Third, the next step is to go into Ubuntu and mount the new hard drive in.
1.
[Email protected]:~# fdisk-l
disk/dev/sda:17.1 GB, 17179869184 bytes
255 heads, Sectors/track, 2088 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Disk IDENTIFIER:0X000AF2A2
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 993 7976241 Linux
/dev/sda2 994 1044 409657+ 5 Extended
/dev/sda5 994 1044 409626, Linux Swap/solaris
disk/dev/sdb:8589 MB, 8589934592 bytes
255 heads, Sectors/track, 1044 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Disk identifier:0x00000000
Disk/dev/sdb doesn ' t contain a valid partition table
You can see one more/dev/sdb.
2.
Here is the format of the Ext3 file system
[Email protected]:~# mkfs-t Ext3/dev/sdb
MKE2FS 1.40.8 (13-mar-2008)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) Y//The whole new hardware is formatted, not partitioned.
Filesystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
524288 inodes, 2097152 blocks
104857 blocks (5.00%) reserved for the Super user
First Data block=0
Maximum filesystem blocks=2147483648
Block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing Inode Tables:done
Creating Journal (32768 blocks): Done
Writing superblocks and filesystem accounting Information:done
This filesystem would be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.
[Email protected]:~#
3.
[Email protected]:~# cd/home
[Email protected]:/home# mkdir Work
[Email protected]:/home# mount/dev/sdb work//mount the hard drive to the work directory.
[Email protected]:/home# CD work
[Email protected]:/home/work# ls
Lost+found
4.
Check the Mount status with the DF command
[Email protected]:~# DF
Filesystem 1k-blocks used Available use% mounted on
/DEV/SDA1 7913216 7803524 0 100%/
Varrun 257788 257548 1%/var/run
Varlock 257788 0 257788 0%/var/lock
Udev 257788 257740 1%/dev
Devshm 257788 257744 1%/DEV/SHM
LRM 257788 39760 218028 16%/lib/modules/2.6.24-19-generic/volatile
/dev/sdb 8322488 149632 7753428 2%/home/work
Gvfs-fuse-daemon 7913216 7803524 0 100%/root/.gvfs
See/dev/sdb 8322488 149632 7753428 2%/home/work
One, visible success.
5. Implement automatic mount on startup.
[Email protected]:~# gedit/etc/fstab
According to the following format
# <file system> <mount point> <type> <options> <dump> <pass>
We add by ourselves:
/dev/sdb/home/work ext3 defaults 0 0
Reboot so you can complete all the steps to add the hard drive.
Add virtual machine to Ubuntu HDD