Page 1 of 1

Low Disk Space in Dynamically allocated Disk

Posted: 20. Dec 2011, 11:13
by neilghosh
I have Ubuntu 11.10 Installed as a guest and now a days I am getting low disk space warning. Is there any way to allocate more hard disk space now ?
or I have to delete the Virtual machine and create a new loosing all my settings and installation ?

I was expecting the Virtual Hard Disk to grows a required however it did not happen. Is this a bug ?

Re: Low Disk Space in Dynamically allocated Disk

Posted: 20. Dec 2011, 14:01
by mpack
That is a FAQ. RTFM and/or search the forums. VirtualBox version would have been useful info too. And lose the irrelevant link in your sig please.

Re: Low Disk Space in Dynamically allocated Disk

Posted: 20. Dec 2011, 14:22
by neilghosh
VB Version 4.1.8

Re: Low Disk Space in Dynamically allocated Disk

Posted: 20. Dec 2011, 14:53
by neilghosh
I am getting the following error

D:\Program Files\Oracle\VirtualBox>VBoxManage modifyhd D:\VM\Ubuntu\Ubuntu.vdi
--resize 2048
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage.exe: error: Resize hard disk operation for this format is not impleme
nted yet!

Re: Low Disk Space in Dynamically allocated Disk

Posted: 20. Dec 2011, 16:07
by mpack
Resize only works with dynamic VDI or dynamic VHD, and the argument for --resize should be the size in megabytes of the new drive, not the size of the additional space.

For example, if you have a 10GB drive and you want a 15GB drive you say "--resize 15000" and not "--resize 5000".

The --resize argument for VBoxManage was introduced in VirtualBox v4, so you do have the right version.

Also bear in mind the following :-

o "resize" will not work properly if you have used snapshots - those have to be got rid of first.
o "resize" will only increase the size of the drive. Gparted or similar must be used to increase the filesystem partition.
o "resize" is an in-place mod, which I regard as dangerous. IMHO you should make a backup first.

Regarding your question about whether your observation about the dynamic drive not enlarging is a bug: no it isn't a bug, because no claim is made that the drive capacity enlarges automatically, and your Ubuntu guest wouldn't support it if it did. The user manual is quite clear on this subject: "dynamic" means that host space for the drive is allocated dynamically (on demand). The drive capacity visible to the guest never changes.

Re: Low Disk Space in Dynamically allocated Disk

Posted: 20. Dec 2011, 20:20
by neilghosh
Thanks for the reply,

Now I am trying to extend the partition to unallocated area in the following thread

viewtopic.php?f=6&t=45989&start=15

Re: Low Disk Space in Dynamically allocated Disk

Posted: 20. Dec 2011, 20:37
by neilghosh
Here is the final solution

1.Resize the virtual disk

D:\Program Files\Oracle\VirtualBox>VBoxManage modifyhd D:\VM\Ubuntu\Ubuntu.vdi -
-resize 20480
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

2.Download the Gparted http://gparted.sourceforge.net/ ISO
3.Add the ISO as Virtual DISK Boot from the it using the same machine in Virtual Box
4.Resize the primary partition which is has low space and extend it to the unallocated space
5.delete the swap and then extend the first partition and make sure to leave enough at the end to add the swap back.

Re: Low Disk Space in Dynamically allocated Disk

Posted: 21. Jun 2021, 10:36
by prunesalad
I know this is a really old thread, but it's top of the rankings in Google for some reason.

I had the same issue with a Debian installation today, and it's really easy to fix.

Make sure the machine state isn't saved (i.e. the machine is shut down as stated in the previous responses)
In the Virtual Box window:

Go to File > Virtual Machine Manager

Select the correct VM.

Use the slider at the bottom to increase the disk size to whatever it needs to be.

Seems like this is a lot easier now that it was 10 years ago....!

Re: Low Disk Space in Dynamically allocated Disk

Posted: 21. Jun 2021, 10:46
by mpack
We have a FAQ on drive resizing that is also younger than this thread, and is maintained for accuracy.
How to resize a Virtual Drive.