Tuesday, May 15, 2018

XCOPY of Disk2VHD converted Windows system drive from MBR to GPT


I needed to convert my Windows system MBR disk into a GPT disk.

First step was to use Disk2VHD utility, to capture the disk in original state.  Saved VHD file on a USB drive.  Used the Windows Server installation disk (Server 2008 R2 - I will be attempting on a Server 2012 R2 later today) to convert the MBR disk to GPT
Then, after converting the disk into a GPT format, I mounted the VHD using diskpart and ran the Xcopy command to copy the Windows system files back to the newly formated GPT disk.  (Used XCOPY h:\ c:\ /h /c /k /o /e /r /y /exclude:c:\excludeme.txt

Obviously, I didn't want to copy the pagefile.sys over to the new disk, so I wanted to use the /EXCLUDE switch to ignore this file.  When I did used /exclude:c:\pagefile.sys, it just hung!!

The main thing I realized in using the /EXCLUDE flag is that you have to put the location of the excluded file list after the flag; not the actual excluded items/terms. Once I realize this, the command ran successfully.


No comments:

Post a Comment