Page 1 of 1

Hard disk management

Posted: 28. Apr 2009, 19:55
by claudio2574
I'm running XP as host and Win2003 as client using VBox 2.1.0
Everything is fine. The client has 2 dynamic hard disks (C: 20 GB and D: 100 GB)
Within client OS, disk C: is using 5.79 GB, but the size of the c.vdi file in the host system is more than 10 GB.
I wonder why this happens and, more important, if there is any way to shrink the .vdi file.
This could save time when backing up the client OS.
May be this topic has been already discussed, but the "search" option of the site tells me to "try later" (???)
Thank you all

Re: Hard disk management

Posted: 28. Apr 2009, 20:21
by Sasquatch
The new 2.2.2 version has the VBoxManage modifyhd --compact feature restored, so you can shrink the VDI again. When upgrading, consult the VirtualBox FAQ for how to do that.

The VDI increases in size, because when you add files and then remove them again, the space isn't brought back.

Re: Hard disk management

Posted: 28. Apr 2009, 21:03
by claudio2574
Sasquatch wrote:The new 2.2.2 version ....
Thanks for the quick reply.

Hmmm, my VBox suggests me to upgrade to 2.1.4. (I did not do because I prefer a stable environment, like mine has been till now). Strange that the "check for updates" does not suggest the 2.2.2. Does it mean that I need more than one-step upgrade?
According to the FAQ, the upgrade does not need an uninstall+install procedure, but if I need more steps probably it is faster to backup the .vdi and .xml files, uninstall the 2.1.0 and start a new 2.2.2 . If needed, I can easily change the HD identifiers within the XML file.
Or not?

Other chance: I have a spare Win2003 system (used for backup purposes only). May be I can install the 2.2.2 over there, do the shrink of .vdi files, then move back them to the XP host. Is it correct or there are compatibility issues?

(Don't think I'm mad to use the XP as host: I need some USB hardware that has no support within 2003.)

Re: Hard disk management

Posted: 28. Apr 2009, 23:19
by Sasquatch
The upgrade can go in one step. From 2.1.x to 2.2.x is no issue.

Your second option, to install 2.2.2 on a different machine will work too. Takes a bit more time due to transferring of the files, but if you think it's worth it, do it.

Re: Hard disk management

Posted: 29. Apr 2009, 12:11
by claudio2574
Well, I made the upgrade to vbox 2.2.2, run the sdelete utility within the client win2003 OS flawlessly, then went back to the host system to run:
VBoxmanage modifyhd d:[....]c.vdi --compact
I got
0%...
and nothing else. The size of the vdi disk remained unchanged.
I see that other users had even worst problem with the --compact option. For example:
http://forums.virtualbox.org/viewtopic.php?f=6&t=17053
Much safer to stay with a big .vdi file. I think I won't use the compact option any more, until the forum reports that it is bugless.
Thanks anyway
Claudio