I have a dynamically expanding .vhd file. The current file size was about 50 GB, with only 29 GB used. However, it recently expanded to about 54 GB, but still only shows 29 GB used.

Are there any reasons that a .vhd file would expand when it still has plenty of unused space?


The .vhd file tracks changes to an assumed blank disk.

Just because some areas of the filesystem aren't used, doesn't mean that they don't have shadow copies or leftovers from previously used files.

This is, for example, how un-delete programs work.

To clarify:

The "unused" space on your disk may not be blank.

  • So if I understand you correctly - this is completely below the windows file system level, and is akin to individual magnetic bits on a physical hard drive. Is there any way to get a report on how much space is unused by the filesystem but still taking up space in the .vhd file? – Nathan Nov 24 '09 at 23:30
  • Another question: why wouldn't the Windows file system on the virtual OS simply overwrite the existing bits in the .vhd file like it would on a physical hard drive? – Nathan Nov 24 '09 at 23:38

In addition to Johns answer, you can regain space by running the pre-compactor application inside the guest - to zero out any unused space inside the vhd. And then run the shrink/compact on the vhd from your virtualization tool... then you'll know the real usage ^^

The precompactor tool is bundled with most releases of Virtual PC and Virtual Server and can for example be found in:

Program Files\Microsoft Virtual PC\Virtual Machine Additions\

It will work for Hyper-V vhd as well regardless of where you sourced the precompactor iso from.

  • Where do I get the pre-compactor application? – Nathan Nov 24 '09 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.