Expanding a Boot VHD on a Domain Controller


I have domain controller in my lab running on Virtual PC 2007 whose boot disk was running out of space.  It was originally formatted as a dynamic expanding disk with a maximum size of 16 Gb, and had reached its capacity.  The virtual machine is also running OpsMgr and SQL 2005. 

I tried using VHDresizer available at http://vmtoolkit.com/files/folders/converters/entry87.aspx but could not get it to work.

VHDresizer is slightly annoying for two reasons:

  1. You have to register to download the product
  2. It took hours, then error’ed out at the very end

Here is how I cloned the boot partition to a larger VHD:

  1. Created a new VHD with a maximum size of 36 Gb using the VHD wizard in Virtual PC 2007 and made note of the location of the file. 
  2. Shut down the virtual PC that was running out of space.
  3. Back up the original boot VHD
  4. In ANOTHER virtual PC running server 2003, I assigned the 16Gb boot drive as the second hard drive (I will refer to this drive as the source)
  5. Assigned the new 36Gb drive as the third drive on the second VPC (I will refer to this drive as the destination)
  6. Using Disk Management, I assigned letter X: to the source drive
  7. Using Disk Management I assigned letter Y: to the destination drive
  8. I formatted the destination drive Y: with NTFS (quick).  Make sure you don’t format the source.
  9. I downloaded the Windows 2003 Resource Kit, which contains robocopy, and installed it on the second VPC  http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
  10. I copied the source to the destination with the following command, which took about an hour
    robocopy X:\ Y:\ /E /COPYALL /R:5
  11. There were 3 copy errors that I ignored (it didnt seems to cause problems–but don’t quote me).
  12. In Disk Management, I marked the destination drive as Active
  13. Shut down the second VPC
  14. Removed the vhd’s from the second VPC
  15. I edited the original VPC .vmc file in notepad and replaced references of the source_drive.vhd with references to the destination_drive.vhd
  16. I started the original VPC and everything worked (much to my surprise) I thought there would be issues with the MBR, or with the server being a Domain Controller, but everything worked fine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s