<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Can someone explain a bit on how to compact a virtual disk?</DIV>
<DIV> </DIV>
<DIV>We may have some resource to finish those un-implemented compact functions for VHD/VMDK/HDD format.</DIV>
<DIV> </DIV>
<DIV>What I can think of is something as follows:</DIV>
<DIV> </DIV>
<DIV>(1) open the disk file, and create a new disk file in the same format, or different format</DIV>
<DIV> </DIV>
<DIV>(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.</DIV>
<DIV> </DIV>
<DIV>(3) copy all used blocks from old disk file to new disk file.</DIV>
<DIV> </DIV>
<DIV>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?</DIV>
<DIV> </DIV>
<DIV>Note it can be also used for converting between different formats.</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV></td></tr></table>