disk space not dynamically growing

Discussions related to using VirtualBox on Mac OS X hosts.
hank
Posts: 113
Joined: 9. Jan 2011, 17:31
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows 7, XP

Re: disk space not dynamically growing

Post by hank »

Good discussion on how to explain this disk space thing better. Luckily I had a coworker who pointed out I'd read but not understood the manual.

Tangentially -- I see others have hit the 'out of disk space' problem causing failure of recent Windows Updates; it's much discussed as a Microsoft issue elsewhere. Try q=microsoft+windows+disk+space+update and it's all over the place.

This guy's answer got several of my guest Windows VMs unstuck from my problem with updates downloading but failing:
http://benosullivan.co.uk/windows/how-t ... ws-update/

YMMV of course.
Mickey_
Posts: 2
Joined: 5. Apr 2012, 07:55

Re: disk space not dynamically growing

Post by Mickey_ »

THe virtual disk resizing and dynamically growing is definitely confusing. I still do not understand it I guess after reading this blog thread and the manual.. I have resized the virtual partition using the modifyhd switch - I added about 8 GB to the 20 GB default partition in the VDI format. It now reports 38 GB, but that is all. It does not use the increased size. AS it stands and as others have experinced, they are out of room with hardly any installe dprograms on a Windows 7 Professioanl 32 bit install? Can you shed any light on this? Can I get it to respect the new size limits? If not can I clone this to a bigger partition without having to redo everything?
Mickey_
Posts: 2
Joined: 5. Apr 2012, 07:55

Re: disk space not dynamically growing

Post by Mickey_ »

Mickey_ wrote:THe virtual disk resizing and dynamically growing is definitely confusing. I still do not understand it I guess after reading this blog thread and the manual.. I have resized the virtual partition using the modifyhd switch - I added about 8 GB to the 20 GB default partition in the VDI format. It now reports 38 GB, but that is all. It does not use the increased size. AS it stands and as others have experinced, they are out of room with hardly any installe dprograms on a Windows 7 Professioanl 32 bit install? Can you shed any light on this? Can I get it to respect the new size limits? If not can I clone this to a bigger partition without having to redo everything?
Further to the note, can you explain more fully the purpose of the Snapshots and the intended usage. Again the manual seems to fall short or I am just that dense. I have done some experimenting with taking and deleting them an really come to no real conclusions. They seem to take up quite a bit of 'real' real estate. THere is also an option for compressing the VHD - THe partition is already compressed abviously...This seems to be misleading and does not make sense. It seems to me that a fixed 20 GB virtual hard drive would be 20 GB in actual disk size, which it is not... IN fact about 6 GB. So the data must be compressed to the max already and in part explains why the partition is already full. THanks for any guiding light?!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: disk space not dynamically growing

Post by mpack »

Mickey - your first question has been asked a thousand times before, it would do you good to search before asking (hint: gparted).

Your second question - what are snapshots - is answered in section 1.9 of the user manual.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: disk space not dynamically growing

Post by loukingjr »

I'm not having this issue however, 16GB is the absolute minimum disk size to get Windows 7 32bit installed. That's just for the OS. If you have restore points active things will quickly fill up just installing a few programs and updates.

as far as the dynamic disk subject I don't believe they are compressed. here's an analogy, they are like a balloon, they fill as you add programs and files but they can only expand to the size you set. if you don't fill them they will never grow to the full size. they only use the amount of space required on the host drive.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: disk space not dynamically growing

Post by stevecoh1 »

All right, I'm going to rephrase Mickey's question.

After R ing TFM, I find section 8.22. Which says:

The --resize option allows you to change the capacity of an existing image; this adjusts the logical size of a virtual disk without affecting the physical size much.[37] This currently works only for expanding the capacity of VDI and VHD formats, and only for the dynamically allocated variants. For example, if you originally created a 10G disk which is now full, you can use the --resize 15360 command to add 5 GByte more space to the virtual disk without having to create a new image and copy all data from within a virtual machine.
This certainly SOUNDS like it's saying that if your guest runs out of disk space you use the --resize command to add more GB from the host's disk and run with it. If other steps are required, this document doesn't explain what they are.

OK, so I used the VBoxManage modifyhd command to modify my disk space from 20 to 30GB. And yet I find I'm still running out of disk space at 20GB. So what OTHER step must I take? Instead of berating the poor user with "googling gparted" why doesn't Oracle F (Fix) TFM to say so????
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: disk space not dynamically growing

Post by BillG »

Because it is not a VirtualBox question. It is a question about how an OS handles disk space, and is exactly the same with a physical disk. The OS works with partitions. No matter how big the disk is, the OS will only see 20G if it is looking at a 20G partition. Gparted is a tool used to change the size of partitions.

Did you google gparted?
Bill
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: disk space not dynamically growing

Post by mpack »

Basically you need to understand the difference between a disk and a partition, which is fundamentally the same as the difference between hardware and software.

VirtualBox is a hardware emulator - it is not an operating system, and doesn't really know what operating systems do on the provided hardware. When you run "modifyhd --resize" you are changing the size of the drive, i.e. it modifies the emulated hardware.

Now, what a guest operating system does with that extra drive space is entirely up to that OS. Some might recognize the space automatically (I don't know of any which do this). Some might crash and die horribly. Most will simply do nothing: they will carry on using the space(s) already allocated to them - called partitions. If you want to change the allocation then you need to use a partition management tool compatible with the guest OS. GParted is a good choice because it's free, has an easy graphical interface (badly needed in a tool you won't use often enough to be really familiar with), can be booted from a live CD, and supports most popular DOS, Windows and Linux filesystems. In any case these are guest OS issues which are beyond the VirtualBox remit.

Exactly the same situation arises if you upgrade the system drive in your physical PC, and copy all the data off the old drive onto the new. The new drive should normally work fine, but the guest OS will not recognize, report or use the new space until it's made to.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: disk space not dynamically growing

Post by ChipMcK »

mpack wrote:Basically you need to understand the difference between a disk and a partition, which is fundamentally the same as the difference between hardware and software.

VirtualBox is a hardware emulator - it is not an operating system, and doesn't really know what operating systems do on the provided hardware. When you run "modifyhd --resize" you are changing the size of the drive, i.e. it modifies the emulated hardware.

Now, what a guest operating system does with that extra drive space is entirely up to that OS. Some might recognize the space automatically (I don't know of any which do this). Some might crash and die horribly. Most will simply do nothing: they will carry on using the space(s) already allocated to them - called partitions. If you want to change the allocation then you need to use a partition management tool compatible with the guest OS. GParted is a good choice because its free, has an easy graphical interface (badly needed in a tool you won't use often enough to be really familiar with), can be booted from a live CD, and supports most popular DOS, Windows and Linux filesystems. In any case these are guest OS issues which are beyond the VirtualBox remit.

Exactly the same situation arises if you upgrade the system drive in your physical PC, and copy all the data off the old drive onto the new. The new drive should normally work fine, but the guest OS will not recognize, report or use the new space until it's made to.
This appears to be a candidate for a tutorial. Best explanation I have read yet.
kgomara
Posts: 3
Joined: 28. Apr 2015, 22:44

Re: disk space not dynamically growing

Post by kgomara »

I'm still confused.

I've built an Ubunto VM. I'm getting a "No space left on device", and indeed a df shows 3.4GB used, .4GB available - and I'm trying up upload a .5GB zip file. I get that part.

But in my VBox Manager it shows I have 8GB "Dynamically allocated..." with an actual size of 3.89GB used. That corresponds closely to the df 3.4GB used.

Why isn't my VM growing to use the rest of the 8GB allocated? Is there a simple fix to allow it to grow (up to 8GB)?

My host is a Mac. If I must clone to a larger VDI are there more straight-forward instructions than the link about using Wine, etc? I don't even know what Wine is...

Thx,
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: disk space not dynamically growing

Post by Perryg »

kgomara wrote:I'm still confused.
I've built an Ubunto VM. I'm getting a "No space left on device", and indeed a df shows 3.4GB used, .4GB available - and I'm trying up upload a .5GB zip file. I get that part.
But in my VBox Manager it shows I have 8GB "Dynamically allocated..." with an actual size of 3.89GB used. That corresponds closely to the df 3.4GB used.
Why isn't my VM growing to use the rest of the 8GB allocated? Is there a simple fix to allow it to grow (up to 8GB)?
My host is a Mac. If I must clone to a larger VDI are there more straight-forward instructions than the link about using Wine, etc? I don't even know what Wine is...
Thx,
This sounds like the guest was installed in LVM or a partition that has filled to much. You can view the structure using the following:
df -h in a terminal and then you should know why and what needs to be done.
kgomara
Posts: 3
Joined: 28. Apr 2015, 22:44

Re: disk space not dynamically growing

Post by kgomara »

Sorry - it is not at all obvious to me how to go about solving the problem. Here's the output of df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 3.9G 3.3G 415M 89% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 2.0G 4.0K 2.0G 1% /dev
tmpfs 396M 496K 395M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 0 2.0G 0% /run/shm
none 100M 0 100M 0% /run/user
MacDocuments 465G 302G 164G 65% /media/sf_MacDocuments

The "disk if filling too much" makes sense - I'm trying to scp a 500MB zip file to the VM. As the above shows, I only have 415MB available, so it fails.

Am I wrong in assuming the VM should "Dynamically grow..." up to the 8GB I have allocated? And if it does grow - does it grow while running (that would seem hard to do), or should a reboot of the VM allocate more space of the 8GB? It doesn't seem to.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: disk space not dynamically growing

Post by Perryg »

Look at df from one of my dev guests:

ubuntu@ubuntu-1504:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 0 2.0G 0% /dev
tmpfs 396M 5.9M 390M 2% /run
/dev/sda1 23G 15G 7.4G 66% /
tmpfs 2.0G 160K 2.0G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
none 466G 133G 333G 29% /mnt/Public-share
tmpfs 396M 4.0K 396M 1% /run/user/116
tmpfs 396M 12K 396M 1% /run/user/1000

The guest had 25GB assigned to it at creation and if you look at the red line you will see /dev/sda1 has 23GB assigned to it. The rest is swap, Etc..

Yours says you have 3.9GB so that is your problem.

Since you have not said what type of partition was used at the creation of the drive I can't tell you anything, but you can easily make the drive bigger by following the following link:
viewtopic.php?f=24&t=50661

You can also see what the partition uses and how it is formatted by downloading gparted live cd and boot the guest with that. You will need gparted anyway as it is part of the process to make the drive larger.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: disk space not dynamically growing

Post by loukingjr »

@kygomara: FWIW, It seems like when you created the guest you chose an 8GB HD (the default for Ubuntu guests and too small). It also seems you may have assigned 2GB to 4GB to RAM. In general installers create a swap file equal to or, up to one and a half times larger than RAM. So nearly half your HD is used up by the swap file and the rest filled with Ubuntu leaving almost no free space.

As Perry said, you can and should resize the .vdi, or if there is nothing important in the guest, just scrap the guest and create a new guest with a larger HD.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
kgomara
Posts: 3
Joined: 28. Apr 2015, 22:44

Re: disk space not dynamically growing

Post by kgomara »

DOH!

Thank you for the explanation - now it all makes sense.

VBox guys - earlier in this thread there is some discussion about a lot of people being confused about Dynamic Allocation... perhaps others were tripped up by not understanding that the swap space nets out of the Virtual space. If I had understood that up front I would have allocated much more space initially and never had the problem.

Thanks all for the excellent support and excellent product.

KO
Locked