+ Post New Thread
Results 1 to 8 of 8
Windows Server 2008 R2 Thread, Shrink Hyper-V VHD file? in Technical; How do I shrink a VHD file with hyper-v? My sharepoint site has a 220gb disk assigned but only using ...
  1. #1
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    3,765
    Thank Post
    898
    Thanked 417 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    87

    Shrink Hyper-V VHD file?

    How do I shrink a VHD file with hyper-v?

    My sharepoint site has a 220gb disk assigned but only using 40gb of it. But the VHD is 200gb so I cannot export/back it up easily.

    Whats the solution?

  2. #2
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    3,765
    Thank Post
    898
    Thanked 417 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    87
    As usual a little more googling found the answer.

    http://sqlsolace.blogspot.com/2008/0...mages-vhd.html

    Its quite hard to find these solutions sometimes as Hyper-V has progressed from a couple of years ago when you needed 3rd party tools to do this.

    Now it seems its inbuilt into the hyper-v management console.

  3. #3

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,172
    Thank Post
    868
    Thanked 2,699 Times in 2,288 Posts
    Blog Entries
    11
    Rep Power
    772
    Is it dynamicly allocated or preallocated. There is a tool in the hyper-V manager where you specify the VHD that allows you to scan, shrink or resize VHDs. Its a button or series of buttons just below the VHD path.

    Edit: looks like you found it while I was writing my answer.

  4. #4
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    3,765
    Thank Post
    898
    Thanked 417 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    87
    Thanks synack, have you done it before?

    Any problems?

    I'm a little worried about doing it on my production Sharepoint server

  5. #5
    jamesfed's Avatar
    Join Date
    Sep 2009
    Location
    Reading
    Posts
    2,202
    Thank Post
    137
    Thanked 342 Times in 289 Posts
    Rep Power
    86
    Personaly I would shrink the partition size of your VM (while inside the VM its self) and then do a disk to VHD (aka physical to virtual) conversion using System Centre Virtual Machine manager or any other tool.

  6. #6

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,752
    Thank Post
    1,278
    Thanked 1,651 Times in 1,106 Posts
    Blog Entries
    22
    Rep Power
    506
    Quote Originally Posted by zag View Post
    Thanks synack, have you done it before?

    Any problems?

    I'm a little worried about doing it on my production Sharepoint server
    Shutdown the machine and copy the VHD file to somewhere safe so can always reattached the old one is something goes wrong.

  7. #7

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,172
    Thank Post
    868
    Thanked 2,699 Times in 2,288 Posts
    Blog Entries
    11
    Rep Power
    772
    Havn't done it before but as was said above you should shrink the partition size in the VM and then do the shrink of the VHD. Taking a copy of it beforehand is also a good plan.

  8. #8
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    3,765
    Thank Post
    898
    Thanked 417 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    87
    Thanks.

    Edited the Disk in settings then compacted it. Took about 20mins but go the size down to 38gb.

    Exported the disk and restarted the server. All backed up now and feeling much happier

    I love virtualization sometimes!

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 3
    Last Post: 27th May 2011, 08:31 PM
  2. Adobe shrink-omatic
    By TechSupp in forum Educational Software
    Replies: 0
    Last Post: 25th May 2011, 12:24 AM
  3. Replies: 1
    Last Post: 20th July 2010, 02:56 PM
  4. sql 2008 shrink log file
    By ful56_uk in forum Windows Server 2008
    Replies: 2
    Last Post: 26th May 2010, 07:45 PM
  5. how to shrink an ldf file
    By ful56_uk in forum How do you do....it?
    Replies: 2
    Last Post: 18th May 2010, 04:36 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •