@@@@@ Backup original VHD first @@@@
a) Perform defragmention of the guest VM
b) First, shrink partition size
c) Then ,shrink VHD size by using VHDResizer.
You can use VHDResizer tool . To get this tool, goto http://vmtoolkit.com/files/folders/converters/entry87.aspx but on Windows Server 2003, there is no option to shrink volume. The VHDResizer cannot shrink the VHD if the partition is still intact with original size.
1. Attach Win2k3 VHD by using Parent host (Hyper V), go to Start > Administrative Tool > Computer Management > Storage > Disk Management > Right click Attach VHD
2. Right click the partition (Disk 4) and select Shrink Volume.
3. Enter the amount of space to shrink.
4. Once you have shrink the partition, right click the VHD Disk and select Detach VHD.
5. Open VHDResizer, enter destination VHD and specify the new size.
Original size is 50GB
Resize to : 31 GB
6. Wait until the process complete. Below is the snapshot of result.
7. Use Hyper V manager snap in to use the new disk (TestExpand2.vhd).