Page 1 of 1

Dynamic Disk Stopped Expanding

Posted: 22. Sep 2011, 14:17
by remidata
I created a 16 GB virtual disk (VDI file) and set it to dynamic expanding. It started very small and over time grew automatically to 12.28GB. It will not grow any more, despite having 3.72 GB more space allocated to the VDI file and 500 GB freespace on the host O/S.

According to the docs, VB will auto-allocate when the guest tries to write to a sector that has not yet been allocated. So, I should simply be able to copy foo.txt to bar.txt and force it to allocate space. It does not, and tells me the disk is full.

What is the command to manually allocate an extent within a VDI file? VB does this internally by calling a sub-routine, and I hope this sub-routine is exposed through an API.

I am using Oracle Virtualbox 4.1.2 on 64-bit Windows 7 host with a 64-bit Oracle Linux 5.5 guest. I tried the same setup with CentOS 5.7 guest and ran into the same problem - the disk never expands to max size.

-Mark

Re: Dynamic Disk Stopped Expanding

Posted: 22. Sep 2011, 15:03
by mpack
I expect your drive contains two partitions, system and swap, the latter being 2-4GB. Your system partition is now full.

See vboxmanage modifyhd --resize for how to increase the drive capacity. Do not try it if you use snapshots. Once the drive capacity is increased, download and use the gparted live CD ISO to manipulate the partition sizes as your require.

VDI files do not have multiple extents, that's a VMWare (VMDK) implementation detail.

Re: Dynamic Disk Stopped Expanding

Posted: 22. Sep 2011, 16:03
by remidata
Thanks! Very good info.

You are correct my swap is 3.2 GB.

Per your suggestion I used the vboxmanagehd utility to grow the logical disk from 16 GB to 24 GB.
c:\Program Files\Oracle\VirtualBox> vboxmanage modifyhd b63c607a-7736-47f7-8185-6660226044e4 --resize 24576
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

I confirmed the new logical size, but the physical size was not changed. Just as you predicted.

I started the Linux guest and ran some copy commands. My physical VDI file grew from 12.28 to 12.57 GB, then it threw error "out of space". I tried another reboot and copy commands, but I am still capped at 12.57 GB. So, we saw VBox tried to grow the device but failed quickly and then could not grow any more. This seems like a bug.

I might try gparted as you suggested in this case, just to get going again, but there's no reason end users should have to do all of this manual work to expand a device when the vendor claims their product will do it automatially. For future vm's I might switch products, or switch to static sized devices.

Re: Dynamic Disk Stopped Expanding

Posted: 22. Sep 2011, 16:08
by mpack
remidata wrote:there's no reason end users should have to do all of this manual work to expand a device when the vendor claims their product will do it automatially
There is no such claim in the user manual. You misunderstood what it says.

gparted is not an optional step. Your guest OS will not automatically recognize that the drive has changed size. You need to use gparted to adjust the partitions to use the additional space.