Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows Server 2016 / How to Mirror (RAID1) Boot GPT Hard Drive on Windows 10/ Server 2016?

April 19, 2023 Windows 10Windows Server 2016

How to Mirror (RAID1) Boot GPT Hard Drive on Windows 10/ Server 2016?

In this article we‘ll show you how to create a software mirror (RAID1) from two GPT disks with Windows Server 2016/Windows 10 installed for UEFI. We’ll consider a full-featured BCD bootloader configuration that provides correct Windows boot and protects your OS and data in case of any drive failure.

So, I have a simple computer with an UEFI architecture and two identical 50GB disks, but without built-in RAID controller. Our task is to install an OS (Windows Server 2016, Windows 10 or a free Hyper-V server) on the first GPT disk and then create a software mirror (RAID1) from two disks.

In most cases, if you choose between software and hardware RAID, you’d better select the latter. Motherboards with an integrated physical RAID controller are available even for home users today.

Write an installation Windows ISO image on a DVD/USB stick, boot your computer from this device (in the UEFI mode, not the Legacy one) and run the installation of Windows Server 2016.

After the installation is complete, open Disk Management snap-in (diskmgmt.msc) to make sure that the first disk is using GPT (Disk Properties -> Volumes -> Partition style –> GUID partition table), and the second one is empty (unallocated).

Contents:
  • Preparing GPT Partition Table for a Mirror on Disk 2
  • How to Convert Disks to Dynamic & Create a Mirrored Disk?
  • How to Create GPT Mirror for EFI Partition?
  • How to Copy EFI partition and BCD Store to a Second Drive?

Preparing GPT Partition Table for a Mirror on Disk 2

install windows on gpt disk

Run the command prompt with the administrator privileges and run diskpart. Enter:

DISKPART>List disk

As you can see, there are two local disks available in the system:

  • Disk 0 – a disk with GPT, Windows is installed on
  • Disk 1 – an empty unallocated disk

two disk to create software raid 1 (mirror)

Clean the second disk again just in case and convert it into GPT:

Select disk 1
clean
Convert GPT

Display the list of partitions on the second disk:

List part

If there is at least one partition on the Disk 2 (in my example it is Partition 1, with the Reserved label and Size 128 Mb), delete it:

Sel part 1
Delete partition override

diskpart convert disk to gpt

Display the list of partitions on first disk (disk 0). Then you will have to create the same partitions on Disk 1.

Select disk 0
List part

There are 4 partitions:

  • Recovery – 450MB, a recovery partition with WinRE
  • System – 99MB, an EFI partition (more about the partition structure on GPT disks)
  • Reserved – 16MB, an MSR partition
  • Primary – 49GB, a main partition with Windows image

efi partition table on windows

Create the same partitions structure on Disk 1:

Select disk 1
Create partition primary size=450
format quick fs=ntfs label=”WinRE”
set id=”de94bba4-06d1-4d40-a16a-bfd50179d6ac”
create partition efi size=99
create partition msr size=16
list part

diskpart create efi and msr partition

How to Convert Disks to Dynamic & Create a Mirrored Disk?

Then convert both disks to dynamic:

Select disk 0
Convert dynamic
Select disk 1
Con dyn

diskpart convert gpt disk to dynamic

Create a mirror for a system drive (drive letter C:). Select a partition on Disk 0 and create a mirror for it on Disk 1:

Select volume c
Add disk=1

The following message will appear:

DiskPart succeeded in adding a mirror to the volume

Open Disk Management and make sure that drive C: synchronization has been started (Resynching). Wait till it is over, it may take up to several hours depending on the size of the C: partition.

diskpart add second drive to mirror

When booting Windows, the Windows Boot Manager menu will appear where you can select what disk to boot from. If you do not select a disk manually, the system will try to boot from the first one in 30 seconds:

  • Windows Server 2016
  • Windows Server 2016 – secondary plex

windows server boot manager, Windows Server 2016 – secondary plex

However, the problem is that the bootloader configuration is stored only on the first drive, and if you lose it you won’t be able to boot Windows from the second drive without additional actions. In fact, you have protected your data (but not the Windows bootloader) from a failure of the second disk only.

A software Windows RAID cannot be used to create a fully functional EFI partition mirror. Since the OS boot files are located on the EFI partition, if the first disk fails, you won’t be able to boot from the second disk without the manual repairing of your EFI bootloader. It is quite hard for a beginner and takes some time (you may not have it if there is a crowd of angry users around).

Now we’ll show you how to copy the EFI partition to the second disk and change the BCD bootloader configuration to enable booting Windows from both the first and second drives.

How to Create GPT Mirror for EFI Partition?

Then you have to prepare the EFI partition on the second disk in the mirror in order your computer can use this partition to boot Windows. Assign the drive letter S: to the EFI partition on Disk 1 and format it in FAT32:

Select disk 1
Select part 2
assign letter=S
format fs=FAT32 quick

format efi partition fat32

Then assign the letter P: to the EFI partition on Disk 0:

select disk 0
select partition 2
assign letter=P
exit

How to Copy EFI partition and BCD Store to a Second Drive?

Display the current BCD bootloader configuration using the following command:

bcdedit /enum

When creating a mirror, VDS service has automatically added the BCD entry for the second mirror disk (labeled “Windows Server 2016 – secondary plex”).

bcd configuraion for mirrored drives

In order to allow booting from EFI partition on the second disk if first disk failure, you must change your BCD configuration.

To do it, copy the current Windows Boot Manager configuration:

bcdedit /copy {bootmgr} /d "Windows Boot Manager Cloned"

The entry was successfully copied to {44d1d6bf-xxxxxxxxxxxxxxxx}

Then copy the configuration ID and use it in the following command:

bcdedit /set {44d1d6bf-xxxxxxxxxxxxxxxx} device partition=s:

If you have done it correctly, this message will appear:

The operation completed successfully.

bcdedit /set device partition

List the current Windows Boot Manager (bcdedit /enum) configuration. Note that the bootloader is now having two options for boot from EFI partitions on different disks (default and resume object).

windows boot manager default and resume boot order

Then you must copy your BCD store from the EFI partition on Disk 0 to Disk 1:

P:
bcdedit /export P:\EFI\Microsoft\Boot\BCD2
robocopy p:\ s:\ /e /r:0

copy efi and bcd configuration

Rename the BCD store on Disk 1:

Rename s:\EFI\Microsoft\Boot\BCD2 BCD

And delete the copy on Disk 0:

Del P:\EFI\Microsoft\Boot\BCD2

del bcd copy

If your first disk fails, you need to select the “Windows Boot Manager Cloned” item in the Windows Boot Manager (boot menu) and then “Microsoft Windows Server 2016 —  secondary plex” in order to boot your Windows correctly.

If one of the disks fails, you will get the Failed Redundancy message in Disk Management snap in.

failed disk in software mirror (raid 1) on windows server

In this case, you will have to replace the failed disk, delete the mirror configuration and create a software RAID 1 from the beginning.

12 comments
7
Facebook Twitter Google + Pinterest
previous post
Managing Windows Server Roles & Features with PowerShell
next post
How to Manage Windows Services with PowerShell?

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

12 comments

INFO STMK July 10, 2020 - 6:00 pm

bcdedit /copy {bootmgr} /d “Windows Boot Manager Cloned”

This command did not work

Reply
INFO STMK July 10, 2020 - 6:17 pm

Fehlermeldung:
Der angegebene Kopierbefehl ist ungültig.
Führen Sie “bcdedit /?” aus, um die Befehlszeilenunterstützung aufzurufen.
Falscher Parameter.

Reply
Grigory July 26, 2020 - 1:14 pm

“default and resume object” is “normal boot” option and “resume from hibernate” option
You must use “bcdedit /enum all” to get all possible boot loader configs

Reply
Igor January 13, 2021 - 12:25 am

Hello,

If one gets an error when doing “add disk=1” (something cryptic about free extents), one can do a single command “extend”, and try “add disk=1” again. Happened on Server 2019.

Thanks for the amazing guide.

Reply
Igor January 15, 2021 - 2:46 am

To amend my previous comment:

*After* selecting the C volume (sel vol c),

In response to the cryptic error when “add disk=1”, do:

shrink desired=10
extend

So, shrink by 10MB first, then extend

Also, I advise to then run:

retain

This poorly documented thing does *something* to the volume, which saves you from “bcdboot” and “bcdedit” errors, if you need to run these.

“retain” seems to solve the following:

bcdboot:
“BFSVC Error: Failed to set element application device. Status = [c000000bb]” (yes, this can happen even with the volumes squeaky clean)
“BFSVC: BCD Error: Failed to convert data for element”
“failed to populate bcd store”

bcdedit /set {default} device partition=C: (cryptic error about unsupported operation)

Lastly, if you have several EFI partitions, like in this mirror case, you might get the following when using bcdedit:

“The boot configuration data store could not be opened” “the requested system device cannot be identified”

The solution is: Assign a drive letter to the desired EFI partition, as explained above, and then:

bcdedit /sysstore driveletter_p:_s:_or_whatever

Please save yourself my 2 days 🙂

Reply
Bruce April 13, 2021 - 4:16 pm

Thanks for the great article. This was exactly what I needed.

Reply
Olli August 24, 2021 - 1:12 pm

Cool, thank you for your HowTo! It works with Win2019 also (no problems/errors when doing 100% step by step). Test with missing Drive0 in a VM and test with missing Drive1 successfully.
But there is no different between the first output of “bcdedit /enum” and the second one, or?

Reply
velaben September 16, 2021 - 1:06 am

Thank you, your guide was easy to follow and worked great on Server 2019! A client’s Supermicro AS-5019D-FTN4 didn’t come with native NVME RAID capabilities, so this satisfied the RAID1 requirement perfectly.

Reply
Windows S*cks September 17, 2022 - 10:10 pm

Win Server 2022: “The disk could not be converted to dynamic because security is enabled” (partition security)

No idea where to change partition security.

Windows is crap. Bill Gates is still crap. F**k Windows in all of its flavors. Something simple like raid1, which is trivial in Linux, takes a f**king rocket propulsion manual to do in Windows. F**k Windows in all possible ways.

Reply
John September 28, 2022 - 10:17 am

Your tutorial is great, Thanks!!!

But I have a question, why you didn’t copy WinRe from original to clone then where did you get the set id=”de94bba4-06d1-4d40-a16a-bfd50179d6ac” after creating partition WinRE? Thanks

Reply
boss October 19, 2022 - 9:40 am

https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions?view=windows-11

This partition must use the Type ID: DE94BBA4-06D1-4D40-A16A-BFD50179D6AC.

Reply
BobbyJoe September 27, 2023 - 9:22 pm

Thank you for the great step by step process for this.

One hiccup I ran into was when I ran the bcdedit robocopy line, the BCD and BCD.LOG files didn’t copy due to being busy with another process. Do I need to manually stop that process so those two files can copy, or do I not need to worry about it. Will it affect the updating or mirror of the drives/volumes? Thanks

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Disable UAC Prompt for Specific Applications in Windows 10?
  • How to Download APPX File from Microsoft Store for Offline Installation?
  • Fix: Windows Cannot Connect to the Shared Printer
  • How to Clean Up Large System Volume Information Folder on Windows?
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10
  • How to Hide Installed Programs in Windows 10 and 11
  • Windows Doesn’t Automatically Assign Drive Letters
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top