Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

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

April 29, 2020 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.

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

Related Reading

How to Sign a PowerShell Script (PS1) with...

February 25, 2021

How to Shadow (Remote Control) a User’s RDP...

February 22, 2021

Configuring PowerShell Script Execution Policy

February 18, 2021

Configuring Proxy Settings on Windows Using Group Policy...

February 17, 2021

Updating Group Policy Settings on Windows Domain Computers

February 16, 2021

5 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

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • How to Sign a PowerShell Script (PS1) with a Code Signing Certificate?

    February 25, 2021
  • Change the Default Port Number (TCP/1433) for a MS SQL Server Instance

    February 24, 2021
  • How to Shadow (Remote Control) a User’s RDP session on RDS Windows Server 2016/2019?

    February 22, 2021
  • Configuring PowerShell Script Execution Policy

    February 18, 2021
  • Configuring Proxy Settings on Windows Using Group Policy Preferences

    February 17, 2021
  • Updating Group Policy Settings on Windows Domain Computers

    February 16, 2021
  • Managing Administrative Shares (Admin$, IPC$, C$, D$) in Windows 10

    February 11, 2021
  • Packet Monitor (PktMon) – Built-in Packet Sniffer in Windows 10

    February 10, 2021
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10

    February 5, 2021
  • How to Move (Clone) Windows to a New Hard Drive (HDD/SSD)?

    February 4, 2021

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Allow Multiple RDP Sessions in Windows 10?
  • How to Repair EFI/GPT Bootloader on Windows 10?
  • How to Restore Deleted EFI System Partition in Windows 10?
  • Network Computers are not Showing Up in Windows 10
  • How to Run Program without Admin Privileges and to Bypass UAC Prompt?
  • How to Configure Google Chrome Using Group Policy ADMX Templates?
  • Error Code: 0x80070035 “The Network Path was not found” after Windows 10 Update
Footer Logo

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


Back To Top