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

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 at 14:27
    
It's a vhd file. –  JohnDoe May 3 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 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: serverfault.com/questions/591666/… –  Grant May 3 at 23:45

2 Answers 2

up vote 1 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

http://www.bursky.net/index.php/2013/02/resize-vhd-volumesize/ 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 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

 
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.