[vbox-dev] orgabout compacting a virtual disk

Huihong Luo huisinro at yahoo.com
Fri Jul 30 10:54:41 PDT 2010

Can someone explain a bit on how to compact a virtual disk?
We may have some resource to finish those un-implemented compact functions for VHD/VMDK/HDD format.
What I can think of is something as follows:
(1) open the disk file, and create a new disk file in the same format, or different format
(2) for each partition, mark free and used blocks. yes, we have code that is file system aware, it can recoginize all popular ones, such as Ext/Reiserfs/NTFS/FAT, etc.
(3) copy all used blocks from old disk file to new disk file.
Would this be a good way of compacting a disk? If there are other simple ways, please let me know. I noted that VDI already implemented compact, how does that work internally?
Note it can be also used for converting between different formats.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100730/7eb0943e/attachment-0001.html 

More information about the vbox-dev mailing list