Home > Uncategorized > How to increase the disk size of a ubuntu vdi on Mac

How to increase the disk size of a ubuntu vdi on Mac

I have spent an hour to figure out how to increase the disk size of my ubuntu virtual machine running on Mac OSX, and decided to write this  🙂

Special thanks to http://tips.kaali.co.uk/2012/03/16/expand-or-increase-the-size-of-virtual-box-vdi-dis/ for the tutorial,  and the steps are: (please refer to that website for some screenshots).

  1. Create a new virtual disk
  2. Clone the old disk to this newly created virtual disk
  3. Disconnect the old disk via storage settings in Virtual Box
  4. Connect/Attach the new disk to the Virtual Machine
  5. Boot up using the new disk
  6. Finally, boot using a Ubuntu live cd, and use gparted tool to extend your volume. Use the following steps for extending the volume in Ubuntu VDI. (Here is a video tutorial: http://www.youtube.com/watch?v=cDgUwWkvuIY)
    1. Open Gparted. You should be able to see the unallocated space.
    2. Right click on swap (/dev/sda5) and select swap off.
    3. Click on the extended volume (/dev/sda2), and select resize/move  to increase the partition to cover all the unallocated spaces.
    4. then select swap, and move it to the right based on.
    5. After that, resize/move the extended volume to shrink to the previous size (to cover swap).
    6. Now, for the final step, select /dev/sda1, and use select/resize to allocate the unallocated space. You will get some warnings regarding data loss, however if you follow all the steps carefully, then you will not lose any data. But, it is important to take backup of your data.

Thanks for reading.

  1. August 15, 2013 at 4:05 pm

    This is a very good tip especially to those fresh to the blogosphere.
    Short but very precise information… Thanks for sharing this one.
    A must read article!

  2. Apu
    January 14, 2015 at 9:58 pm

    There’s actually an even easier way:
    VBoxManage modifyhd [myvm.vdi] –resize 50000

    See here for details:
    http://www.dracata.net/2013/04/resizing-a-virtualbox-vhd-or-vdi-file-on-mac-os-x/

  1. September 20, 2013 at 6:11 am

Leave a comment