Friday 24 August 2012

Resize VHD With Bitlocker Partition

I recently created a new virtual machine under Hyper-V not noticing the default was a dynamic disk and the disk size was set to 127 gig (oops). So I thought okay I will convert it to a fixed disk using the Hyper-V tools and then shrank the partition to 50 gig in windows using disk manager without any problems.
After a quick search with my favourite search engine it seemed I needed a tool called VhdResizer . This was because the VHD was still seen as a 127 gig disk so I needed to chop off all that unallocated space.

So my first attempt went like this:
Opened VhdResizer
Selected the source and destination
Set the size for the new disk

So I was ready to go at this point but the resize button was still greyed out. This turned out to be that the free space was in the middle of the drive because there was a 300 meg bitlocker partition on the disk and the minimum size I could select was the whole 127 gig!
After much head scratching I decided to boot the VM from Gparted  CD image and move the bitlocker partition. To my surprise this worked fine and the VM booted without issue (phew). I then ran VhdResizer again and selected the minimum size which was the size of the C: drive partition but the resize button was still greyed out (grrrrr) I then increased the size by 1 gig and the button was available to start the process. The process ran to completion and I updated the VM to use the new disk. Job done!

So if you want to resize a VHD you must do the following things.

Resize your partition in disk manager
Make sure the free space is at the end of the disk (Use a tool like Gparted if necessary)
When VhdResizer states a minimum size you must select 1 gig above that.

Hope this helps someone with the same issue.

1 comment:

  1. Extraordinary Article it its truly useful and inventive update us as often as possible with new upgrades. its was truly important. much appreciated 70-761 exam questions

    ReplyDelete