Search This Blog

Monday, July 5, 2010

Shrink VHD size

Well, we all know that Hyper V Manager snap in provide us a tool to expand VHD size when require.

Now, How about shrink a VHD size? You may come to a situation when your existing VHD is Fixed Disk which you accidentally create to large size which not even 10% utilize. In order to shrink the size of the VHD, you need to

* Backup original VHD first *
a) Perform defragmention of the guest VM (optional)
b) First, shrink partition size
c) Then ,shrink VHD size by using VHDResizer.

You can use VHDResizer tool . To get this tool, go to but on Windows Server 2003, there is no option to shrink volume. The VHDResizer cannot shrink the VHD if the partition is still intact with original size.

Without wasting any more time. let me show you how i shrink a Windows Server 2003 -Fixed Disk.

1. Attach Win2k3 VHD by using Parent host (Hyper V), go to Start > Administrative Tool > Computer Management > Storage > Disk Management > Right click Attach VHD

2. Right click the partition (Disk 4) and select Shrink Volume.

3. Enter the amount of space to shrink.

4. Once you have shrink the partition, right click the VHD Disk and select Detach VHD.

5. Open VHDResizer, enter destination VHD and specify the new size.
Original size is 50GB
Resize to : 31 GB

6. Wait until the process complete. Below is the snapshot of result.

7. Use Hyper V manager snap in to use the new disk (TestExpand2.vhd).

Cool right !...
p/s:- No guarantee provided. Use it at your own risk.
If working on your side, just leave a comment so other can review it.

Thank you , Stay Tuned.


  1. permissions are different on the new .vhd file. VMM can't start it. IDE/ATAPI account does not have access to open.... I am going to look into it, any help would be appreciated.

    Found this in a forum and it worked

    "I just ran into this after running a year's worth of windows updates. What finally worked was to simply change the Hardware configuration Channel to Primary Channel (1) AND THEN Change it back to Primary Channel (0) (in use)."

  2. Program works good and quick. Just what I was looking for.

  3. I make this process and work very good

  4. It works with help of CJA333's solution. Thanks a lot!

  5. It's just manage to help me shrink my vhd file from 2TB to 50GB. thanks.
    However, when i use the vhdresizer to select the vhd file, it throw error "Invalid VHD file. Please select another".
    What is the problem of this? And how to get this solve?

    1. Haha, you fucked up! Take a copy of the vhd (just to make sure it won't go wrong). Follow the steps on the following site. It should work.

    2. You need to un-attach the vhd from Disk Management before you can select it from VHDResizer. That's all.

  6. Worked a treat for me, resized a Windows XP Pro VHD running in Hyper-V on Windows Server 2008R2.
    I did need to do the additional step noted by CJA333

  7. This worked like a chnarm for me! Great way to resize Server 2003 VHDs.

  8. Michael Kors Handbags Sale Clearance can be found in many different places unlike other luxury handbags.
    Michael Kors Outlet Online are great for any occasion.
    Michael Kors Factory Outlet is perfect for those who like to carry fashion bags.
    Michael Kors Bags Outlet are always great to own when you need a bag to go with everything.
    Michael Kors Outlet Online is so universal that it could appeal to everyone.


Note: Only a member of this blog may post a comment.