How to resize a VirtualBox VDI disk

How to resize a VirtualBox VDI disk

1. Backup the current disk. (Optional but highly recommended).

$ cd ~/VirtualBox\ VMs/OL6 $ ls -al |grep OL6.vdi -rw---  1 ichamma1  1089479487  26034171904 May 16 09:18 OL6.vdi

$ VBoxManage clonehd OL6.vdi OL6_cloned.vdi

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Clone hard disk created in format 'VDI'. UUID: c0ee892e-add5-4c6f-8deb-1a7c04d2a2ae


 * 1) http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi
 * 2) $ VBoxManage modifyhd --resize

$ VBoxManage modifyhd OL6.vdi --resize 61440 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

After you’ve physically resized your drive, both VirtualBox and your OS should know about the changes.

[oracle@ol6 ~]$ df -k Filesystem          1K-blocks      Used Available Use% Mounted on /dev/mapper/vg_ol6-lv_root 25907508 20923632   3667832  86% / If your VM OS is Windows, you may have to run the Disk Management too to refresh the disk size.

References:
 * http://www.gubatron.com/blog/2011/08/29/how-to-resize-a-virtualbox-vdi-fixed-size-virtual-drive-on-mac/