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 have a hyper-v server that I originally created several partitions on but moved those to attached drives.

Here is the drive now:

enter image description here

I'd like to remove the 160gb Unallocated space. I tried to compact the drive but that did nothing.

I am running Windows 2012R2 as my dedicated server and the virtual machine is Windows 2008.

Is there a way to remove this unallocated space?

Any suggestions?

share|improve this question
Is the drive VHD or VHDX? – Grant May 3 '14 at 14:27
It's a vhd file. – JohnDoe May 3 '14 at 16:42
You're question doesn't make sense. Is this the Hyper-V server (the host) or is this a Hyper-V guest (virtual machine)? – joeqwerty May 3 '14 at 22:42
@joeqwerty the screenshot was from inside his VM. He removed some partitions in the virtual machine, but still needed to shrink the VHD file. Easier to get if you had seen his previous question:… – Grant May 3 '14 at 23:45
up vote 2 down vote accepted

There is no native way to shrink VHD files. VHDX files can be shrunk from the user interface or powershell, but that feature doesn't exist for the older VHD format.

Not to worry however - someone wrote a tool to resize VHD files for you. This requires the virtual machine be taken offline, and will generate a new, smaller VHD to replace it with.

enter image description here has instructions on using it, as well as a download link since the original site seems to be gone.

share|improve this answer
Thank you for the help! – JohnDoe May 3 '14 at 23:38

Convert your VHD to VHDX, shut down VM, shrink VHDX. VHDResizer works but is very slow and unsupported. Converting takes a bit of time, but shrinking the vhdx is very fast.

share|improve this answer

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.