So I run Vmware on Vista with a virtual install of Ubuntu on an 8GB partition - well, the 8GB filled up, so I needed to expand the ext3 partition.
The three steps to take are:
1. Expand the VMWare partition using the vmware tool (comes with vmware workstation and others)
Here is a link that describes how to do this: http://4sysops.com/archives/expanding-a-virtual-vmware-disk/ . It is fairly easy to do.
The code looks something like this:
'vmware-vdiskmanager -x 10GB myDisk.vmdk'
2. Now, download a live cd that you can boot from, knoppix is the one I used http://knopper.net/knoppix-mirrors/index-en.html — just download an iso file of it. You’ll want to boot vmware from this iso, so what you do is in the Vmware Workstation sidebar, put this iso in the CD Drive (click on the CD drive and load this iso, easy!). Now you need to tell Ubuntu to boot from CD, so go to VM –> Power –> Power on to Bios. Now, this will start up the Vmware bios, now go to the boot menu and press the ‘+’ sign to move the CD Drive up to the top (so it boots first before the hard drive, so that ubuntu will start from this live cd iso that we downloaded).
3. Now Knoppix should be loading, (you may have to hit like ‘return’ to get it to start loading) - once its fully loaded, open up a terminal. type ‘gparted’ in the terminal to run gparted. Now it should show all your partitions and such. Unmount all the drives you need to do stuff with using:
su root
umount /dev/nameofdrive, i.e........ umount /dev/sda1
If the swap partition becomes an issue root, i.e. you need to delete it, you need to turn it off first, so just do:
swapoff -a
Now, make sure there are no partitions between the free space and the original partition you want to expand. Simply select the partition you want to expand and select how much you want to expand it! Then click ‘apply’ in gparted to actually do it, and it should take a while before saying completed.
If the swap partition is between the free space and the other partition, you will need to delete the swap partition and create a new one at the end of the free space.
Once you have hit ‘apply’ in gparted, and it tells you everything was successful, shut it down, and then go back to vm–>power –> power on to bios and reset your boot so that it doesn’t run from CD first anymore. Then restart and it should load up your regular installation (in my case vmware), but this time with more space for you to use!
Note: You should probably check that things are working, and you may have to make a few edits. First, you should type (as root, or on ubuntu use sudo as shown):
sudo fdisk -l
</pre>
This will list all the partitions you have, make sure its set up properly. Now, if you deleted a swap file, you should check to see if the new swap you created is being used:
free -m
</pre>
This should show how much swap is being used. If your swap is not on, well turn it on using 'swapon'. Use the command 'blkid' to check the names of your partitions, then edit the /etc/fstab file and make sure that the names of the partitions are all the same as the ones you saw when you used the blkid command. If they aren't, change the /etc/fstab file to the correct ones.