+ 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,762
    Thank Post
    897
    Thanked 416 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    86

    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,762
    Thank Post
    897
    Thanked 416 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    86
    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,076
    Thank Post
    853
    Thanked 2,676 Times in 2,270 Posts
    Blog Entries
    9
    Rep Power
    769
    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,762
    Thank Post
    897
    Thanked 416 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    86
    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,193
    Thank Post
    134
    Thanked 340 Times in 287 Posts
    Rep Power
    84
    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,735
    Thank Post
    1,272
    Thanked 1,645 Times in 1,101 Posts
    Blog Entries
    22
    Rep Power
    505
    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,076
    Thank Post
    853
    Thanked 2,676 Times in 2,270 Posts
    Blog Entries
    9
    Rep Power
    769
    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,762
    Thank Post
    897
    Thanked 416 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    86
    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
  •