It didn’t take me long to find out that my Ubuntu system in the VirtualBox has an inconvenient issue. It ran out of disk space! The original plan is to use it for light experiment, so I only allocated 6GB of disk space for the Ubuntu system. But since I liked it and experimented with it a little bit more, it is currently 94% utilized.

Fortunately, the native virtual disk image (VDI) file format allows you to dynamically change its size. To do that we will need to use the VirtualBox management tool “VBoxManage” to handle it. You can find it in the VirtualBox installation directory, for my case it is in “c:\Program Files\Oracle\VirtualBox”.

1. Check the Stoge file

2. Resize the VDI file

I decided to increase the disk space to 20GB.

3. Create a new partition with the newly allocated disk space

After changing the disk space with VBoxManage, the newly added disk space is shown up in the virtual system as unallocated. We need to create a new partition to use it in the virtual system. I am using a free tool called Gparted for this purpose.

3.1. Mount the Gparted image

After you download the ISO image of the Gparted, mount it to the CD.

201306300000

3.2. Boot into the Gparted System

When booting from the Gparted image, you need to press a whole bunch of enter kay. Then you will see the unallocated disk space in the following window.

201306300001

3.3. Create a new partition.

 

201306300002 201306300003

4. Use the new partition in the Ubuntu system

After creating the partition, reboot with hard disk, check the devices in the system

You will be able to see the new partition in the list.

I wanted to mount the /dev/sda3 as my /data directory. So I modified the fstab file as following.

201306300004

Reboot, and you can see the new partition is mounted.

Well done.


 

How to Add Extra Disk Space to Ubuntu in VirtualBox
Tagged on:         

Please tell us what's in your mind ...

%d bloggers like this: