Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to move all the data on a drive in Windows Server 2003 to the beginning of the drive (a virtual hard drive) so that I can more fully compact the .vhd file. However, the Windows server 2003 built in defrag tool only defrags the files, leaving large gaps of freespace (on the order of Gigabytes) that prevent me from compacting the file.

Is there any way to consolidate the data at the beginning of the drive in Windows Server 2003?

Edit: Under Hyper-V, it is no longer necessary to defragment and precompact the .vhd. Simply run the Hyper-V compacter and it takes care of everything. Accepting the answer below because it does help consolidate free space.

share|improve this question
up vote 0 down vote accepted

Numerous free defrag utilities have this ability but my current favourite is Defraggler:

The feature you want to use is 'Defrag Free Space'.

share|improve this answer
That helped some, however, it left a gap of several gigs, then a single 4 KB block. Arg. Also, when I use the "Analyze" portion of the build in Windows defragmenter, it shows a larger portion of free space that defraggler says is filled. Defraggler also won't let me re-run the "Defrag free space" option. – Nathan Nov 30 '09 at 21:36

Your Answer


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.