Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

Thanks synack, have you done it before?

 

Any problems?

 

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

Posted
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.
Posted
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.

Posted
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.
Posted

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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...