| « Backing Up and Restoring | HOWTO To Change The Hostname » |
This is what I do to make sure I can easily and simply enlarge the virtual disk for my Linux Vmware guests.
When installing make sure there is a /boot partition of around 250Mb at the beginning of the disk. This is plenty and should never need to be resized.
Next I put the swap partition and then the remaining unused disk as a single partition mounted as root. This means the disk space that is in use is at the end of the disk. If you put the swap space at the end of the disk you have to keep moving it and that just takes time.
I also add a label to both the boot and root partitions created above as it makes identifying in the /etc/fstab much much easier....
For a Ubuntu Server (Hardy) I use a 2Gb disk, pre-allocated space. As described above it is divided up as 250Mb boot, ext3 followed by 512Mb Swap the remaining is with reiserfs.
df -h /
When you need to enlarge the disk, close down the Vmware guest machine and from the host machine we can make the disk larger with the Vmware tool. Say we want to add another 1.5Gb that makes the total disk size 3.5G.
We need to use gparted to enlarge the partition on the drive without loosing all the data. So Load up another Vmware guest and add the disk we just enlarged. Gparted needs X, I use my default Desktop install here. Boot this other machine and make the partition larger with gparted. When that is complete. Close down the Vmware machine and boot the guest you are altering the disk for.
Check all went well with the disk free command. If the guest boots it's a pretty good sign. ![]()
df -h /
If you put the swap area at the end of the drive you have to move that as well. That just adds complication so I don't do it.