Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
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
add comment

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.

share|improve this answer
    
Where do I get the pre-compactor application? –  Nathan Nov 24 '09 at 23:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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