Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resize VHD from 200GB to 20gb?

Posted on 2011-02-23
4
Medium Priority
?
5,504 Views
Last Modified: 2013-11-06
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?


0
Comment
Question by:JReam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 13

Accepted Solution

by:
Greg Hejl earned 1200 total points
ID: 34966193
are these 2008 OS VHD's?  then VHDResizer is the tool

if they are data vhd's just copy the files onto a new 'right size' vhd and destroy the old one.

if they are 2008 OS VHD's i would recommend they be between 40 and 60 GB

20 GB partitions was ok for 2003 server when they were new - my 20GB partitions are busting at the seams with all the updates over the years.
0
 
LVL 42

Assisted Solution

by:kevinhsieh
kevinhsieh earned 200 total points
ID: 34966802
You can convert a fixed VHD to dynamic and then compact it, which is perfectly reasonable IMHO, but it still appears to the VM as a 200 GB disk and it can potentially fill again. If you converted it back to fixed it would blow up to 200 GB again, which gets you nowhere. You do need to use VHD resizer if you want to shrink the size of the VHD down.

Since you are using Hyper-V R2 I would convert the disks to dynamic since there isn't a significant performance penalty to using dynamic vs fixed VHD and it is a lot easier to copy a 40 GB dynamic VHD that is only 12 GB in physical size than it is to handle a full 40 GB file.
0
 
LVL 4

Assisted Solution

by:jhindson
jhindson earned 600 total points
ID: 34969723
You can use VHD Resizer to change the VHD size, but as kevinheieh eluded to you will also have to change the size of the NTFS partition in order for the VM to recognize the resized disk. Diskpart works well for resizing the NTFS partition size. I have successfully used VHD resizer and Diskpart to change not only data VHD's but also system VHD's containing an OS (even though this is not technically supported). When I go through this process I usually refer to this site:  http://4sysops.com/archives/free-vhd-resizer-shrink-or-expand-a-hyper-v-vhd/, by Michael Pietroforte.
0
 
LVL 1

Author Closing Comment

by:JReam
ID: 34997782
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.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

From Coral's  "So You Want To Play With Computers" Series A bit of background first, so this story will make a little sense. One day, probably because he needed a good laugh, Finagle hooked me up with a church to upgrade/run their Media Booth.…
You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question