The title says it all.
I created the disk and now I would like to increase its size. I know I could add a new one, but I don't want to.
The guest os in question is Ubuntu 11.04
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
There is a very good blog entry on this at http://trivialproof.blogspot.com/2011/01/resizing-virtualbox-virtual-hard-disk.html
Basic instructions, to resize to 30G:
Shutdown any VM using the disk.
"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd c:\path\to\ubuntu_big.vdi --resize 30000
There's a section in the VirtualBox Manual which tells you how to resize a VM Hard Disk using a cmd-line tool. Would this be any good?
My root (/) file filesystem was full on Guest VM with OS of Oracle Enterprise Linux (OEL) 7 created on Oracle Virtualbox. I believe similar steps should be present for other Linux flavors like Redhat, Fedora, CentOS or Ubuntu.
To increase disk space I followed below steps:
Increase size of virtual disk using below command:
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe modifyhd [absolute path to file] --resize [size in MB]
Downloaded the Gparted live iso from here
Mount Gparted iso in Optical Drive of the VM.
Increase LVM using below command (assuming root volume is ‘/dev/ol/root‘)
lvextend -L+10G /dev/ol/root
lvextend -l +100%FREE /dev/ol/root
Increase the file system size:
df -k /
Hope it helps!
Updated instructions for VirtualBox 5 and Ubuntu 16, assuming a Windows host:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifymedium disk PATH-TO-VDI-FILE --resize NEW-SIZE-IN-MEGABYTES
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifymedium disk GUID --resize NEW-SIZE-IN-MEGABYTES
df -kto find the name of the MOUNT-POINT you need to resize (in the right column of the output) and to take note of the name of its corresponding PARTITION-NAME in the left column.
sudo umount MOUNT-POINT
sudo gparted, choose the correct virtual disk from the dropdown in the top right corner, and in the resulting graphical display, right-click on the PARTITION-NAME's box or its entry in the table, choose resize/move, and in the resulting dialog, resize it to fill the new space. Click the Resize button to close the dialog, then in the main window, choose the checkmark icon from the icon toolbar to apply the change.
Incase you want to know how to Increase disk space using the Gpart see : https://prasadlinuxblog.wordpress.com/2014/01/23/use-gparted-to-increase-disk-size-of-a-linux-native-partition/
Also i had to download amd64 version of Gparted as the i686 version didn't work