How to increase the disk space of a VMware virtual disk?

I have a VM running Ubuntu, and I wish to increase its size from 20 to 40 GB.

I powered off the VM and on the VMware side increased the allocated disk space. I did this by Edit Virtual Machine Settings -> Hard Disk -> Utilities and so forth. It then warned me that I should increase the partition size within the guest VM.

Looking at the disk usage analyzer inside of Ubuntu, it only currently sees the original 20 GB. How do I increase this to the 40 I allocated?


Solution 1:

As it says, you need to increase the partition. Resizing the virtual disk, just changes how big partitions can be. You can't resize an active filesystem so the easiest way to do this is:

  1. Boot the VM to a LiveCD ISO of Ubuntu (what you installed from should do but a later/earlier ISO will work too)
  2. When asked click Try Ubuntu
  3. Load gparted aka Gnome Partition Editor. I think it's installed on every CD but you might have to grab it from the Software Centre.
  4. Find your disk, right click it and go through the resize wizard.
  5. Restart the VM without the LiveCD and you should have more free space.