Tuesday, August 02, 2011

Windows: How To Compact A Dynamic VHD

Windows: How To Compact A Dynamic VHD: "This becomes a problem if you make use of multiple VHDs because you are essentially wasting space on files that no longer exist. The solution is to Compact the VHD using Diskpart a tool provided with Windows.."

I have a Hyper-V Windows 2008/Sharepoint 2010 VHD which I am dual-booting from Windows 7. Works great once the memory is beefed up to 8gb. However, during execution the VHD mysteriously expands to 132GB. After shutting down it comes back to a more reasonable(?) 55GB.

Might not be applicable in this scenario, but for those who want to shrink a VHD file without the Hyper-V manager, see above.

No comments: