Link to home
Start Free TrialLog in
Avatar of JReam
JReamFlag for United States of America

asked on

Resize VHD from 200GB to 20gb?

We have Windows Server 2008 R2, Hyper-V R2, 64Bit, etc.

Currently the VHDs are Fixed 200GB.  
Desired: knock these down to more realistic 20GBs,  and stay Fixed.

I've read that I may need to use a tool from year 2007 called VHDResizer.  

Can't I simply within the Hyper-V manager:  
1) Convert to Dynamic
2) Compact
3) Then convert back to fixed

Do I really to need to use VHDResizer?
Is there an easier way to reduce disk size of my fixed VHDs?


ASKER CERTIFIED SOLUTION
Avatar of Greg Hejl
Greg Hejl
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of kevinhsieh
kevinhsieh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JReam

ASKER

Thanks for your valuable comments.    Note:  I disagree with kevinhsieh about using Dynamic disk, most articles I've read strongly recommend Fixed for most production environments, for numerous good reasons.  

Here are the steps I used to successfully reduce many of my VHD sizes.

Steps:
1)  In VM, in Administrative Tools, Computer Management, Disk Management, Shrink Volume to desired size such as 60GB, leave at least 50% to grow on.
2)  Stop VM.  
3)  Backup VHD File.  Zips nicely 90%.  
4)  Use VHDResizer to reduce the size of the VHD File, for example size to 65GB
5)  Swap VHD files, or point Hyper-V manager to new named VHD file.
6)  Start VM,  verify aok in Administrative Tools, Computer Management, Disk Management.  There should be a little unused extra space allocated.
7)  Extend the volume partition to allocate the remaining little unused extra space on the VHD.  Either do:
7a)   In AdTools, Disk Management. Rt Click the Volume | Extend.  This works on Win 2008 R2 VM.
7b)   In VM, CMD prompt, use diskpart, to extend the partition.   C:>DISKPART , List Volume,  Select Volume n,  Extend.  
8)  Verify everything aok in Administrative Tools, Computer Management, Disk Management.