Windows – How to reacreate the EFI partiton and mirror and existing system partition of an GPT disk

diskmanagementgpthard drivemirrorwindows

I have the following setup (very well possible that this is no good practice but it is the given situation):

There were 2 x 3TB dynamic GPT disks in a Windows server, Disk0 with EFI (~200 MB), System reserved (~100MB) and C (200GB) and the rest unallocated.
Disk1 had a mirror of C and the rest unallocated.

Now Disk0 failed and had to be replaced with an identical new disk. And windows isn't booting anymore (I guess this is normal as there is no more EFI partition etc.)

The question is, what is the best/fastest way to get an EFI/System reserved partition back and mirror the healthy C partition from Disk1 to Disk0 (and of course also boot from it again)? I tried some basic stuff with diskpart but couldn't find anything helpful, still I guess diskpart would be the tool to go with but also here I'm not sure…

Best Answer

For starters, I'd disconnect the disk with the remaining good mirror of the old "C:" volume and set it aside. If you don't have a backup of that disk I'd make a backup immediately. You don't want to do anything to the remaining copy of the "C:" volume accidentally, so I'd keep it disconnected from the machine until you're absolutely ready for it.

I'd install Windows to the new disk to get the basic partitions recreated. (You could accomplish this other ways but, personally, I'd find it easier to let the Windows installer just do this for me.)

Then I'd boot a Windows setup DVD and use diskpart to delete the "C:" volume created during the new Windows installation (SELECT DISK 0, LIST PARTITION, DELETE PARTITION x). I'd convert the new disk to a dynamic disk (SELECT DISK 0, CONVERT DYNAMIC).

At this point, being done with deleting partitions, I'd be comfortable reattaching the disk with the mirror of the old "C:" volume. I'd boot the Windows setup DVD again and create a mirror of the old "C:" volume using the free space in the new disk as the destination. You'll probably need to BREAK the old mirror first. Then you can create a new mirror (SELECT DISK 1, LIST PARTITION, SELECT PARTITION x, ADD DISK=0).

I'd allow the mirror to completely synchronize and then I'd attempt booting.

Obviously, double and triple-check the disk numbers, partition numbers, etc, in the commands before you run them. If you have any doubts install a test machine in a hypervisor and try all of this out "under glass" before you try it on the real hardware.

Oh, and make a backup of the disk with the still-good mirror of the "C:" volume.