Nicolas

2 minute read

I add to resize an OSGeoLive virtual machine because after a couple postgresql workshops with quite big datasets (less than 1 GB each but still), the default size was not enough.

So I followed the instructions from here (in French): http://blogf.leunens.fr/2015/1306/agrandir-la-taille-dun-disque-virtualbox.html

Please note that,by default, OSGeoLive cames into a vmdk file so you need to convert it to a VDI to increase the volume size. If you already use a VDI file, not need to do that step.

# get into the VM storage folder
cd /media/data/MachinesVirtuelles/OSGEOLIVE\ workshop/

# check for the vmdk file
ls

# clone vmdk image into a new vdi one
VBoxManage clonehd --format VDI OSGEOLIVE\ workshop-disk001.vmdk OSGEOLIVE_workshop.vdi
## STOP HERE AND CHECK THAT THE NEW ONE WORKS

# Resze the new image
VBoxManage modifyhd  OSGEOLIVE_workshop.vdi --resize 40960

At this point you have a new image with a 40GB storage, but the partitions inside are still the same size, you need to resize it.

To do that, I used a Gparted live cd from gparted.org.

New drives

Then boot on the GParted LiveCD and follow instructions.

I deleted the swap partition because system already had 8 GB of RAM and I’m on a SSD so I try to avoid swapiness.

The final result is a 40 GB ext4 partition.

Big partition

When finished, stop the GParted liveCD, change VM boot options (Hard Drive before Optical) and check that the Live CD is no more in the storage devices.

Boot the machine with the new storage device. It will take some time for the system to check the new filesystem but it should be ok.

Check new size

As you can see / as now 18G available on 40G. Mission completed !