PS C:\Users\Administrator> diskpart
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> convert gpt
DiskPart successfully converted the selected disk to GPT format.
DISKPART> list part
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Reserved 15 MB 17 KB
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> list partition
There are no partitions on this disk to show.
DISKPART> create partition EFI size=100
DiskPart succeeded in creating the specified partition.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
* Partition 1 System 100 MB 1024 KB
DISKPART> format fs=fat32 quick
100 percent completed
DiskPart successfully formatted the volume.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> create partition MSR size=16
DiskPart succeeded in creating the specified partition.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 100 MB 1024 KB
* Partition 2 Reserved 16 MB 101 MB
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> create partition PRIMARY size=524
DiskPart succeeded in creating the specified partition.
DISKPART> format quick fs=ntfs
100 percent completed
DiskPart successfully formatted the volume.
Windows 使用 ID 来区分 Recovery 分区和普通 NTFS 分区,因此需要将该分区的 ID 设置为表示恢复驱动器的 ID。首先从 Disk 0 上的 recovery 分区获取 ID:
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
DiskPart successfully set the partition ID.
DISKPART> detail partition
Partition 4
Type : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden : Yes
Required: No
Attrib : 0000000000000000
Offset in Bytes: 33808187392
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
* Volume 4 NTFS Partition 524 MB Healthy Hidden
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> convert dynamic
DiskPart successfully converted the selected disk to dynamic format.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> convert dynamic
DiskPart successfully converted the selected disk to dynamic format.
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> assign letter=q
DiskPart successfully assigned the drive letter or mount point.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> assign letter=z
DiskPart successfully assigned the drive letter or mount point.
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> remove
DiskPart successfully removed the drive letter or mount point.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> remove
DiskPart successfully removed the drive letter or mount point.
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> assign letter=p
DiskPart successfully assigned the drive letter or mount point.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> assign letter=s
DiskPart successfully assigned the drive letter or mount point.
Open Disk Management (Right click the Windows icon on the bottom left corner of screen, and click "Disk Management"), right click on Disk 1 and make it Online.
Open PowerShell as Administrator, and use the diskpart utility to create GPT partition table on Disk 1, which is shown as "Not initialized" in Disk Management.
PS C:\Users\Administrator> diskpart
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> convert gpt
DiskPart successfully converted the selected disk to GPT format.
DISKPART> list part
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Reserved 15 MB 17 KB
A default partition is created during GPT partition table creating, we do not need this and this partition needs to be deleted.
The next step is to gather partition information on Disk 0, so that the proper partitions can be created on Disk 1. Open another PowerShell window, and start the diskpart utility then select Disk 0:
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> list partition
There are no partitions on this disk to show.
DISKPART> create partition EFI size=100
DiskPart succeeded in creating the specified partition.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
* Partition 1 System 100 MB 1024 KB
DISKPART> format fs=fat32 quick
100 percent completed
DiskPart successfully formatted the volume.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> create partition MSR size=16
DiskPart succeeded in creating the specified partition.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 100 MB 1024 KB
* Partition 2 Reserved 16 MB 101 MB
And the Primary Partition, before creating the partition, we need to know exactly the size of the partition in MB. One way to get this size in MB is to do some calculation on offset in bytes. First get the offset in bytes of partition 3 and 4 on Disk 0:
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 100 MB 1024 KB
Partition 2 Reserved 16 MB 101 MB
Partition 3 Primary 31 GB 117 MB
Partition 4 Recovery 524 MB 31 GB
DISKPART> select partition 3
Partition 3 is now the selected partition.
DISKPART> detail partition
Partition 3
Type : ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
Hidden : No
Required: No
Attrib : 0X8000000000000000
Offset in Bytes: 122683392
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
* Volume 0 C NTFS Partition 31 GB Healthy Boot
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> detail partition
Partition 4
Type : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden : Yes
Required: Yes
Attrib : 0X8000000000000001
Offset in Bytes: 33808187392
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
* Volume 2 NTFS Partition 524 MB Healthy Hidden
The size of partition 3 in bytes is the offset of partition 4 minus the offset of partition 3, which is 33808187392 - 122683392 = 33685504000 bytes, divide by 1024 we get 32896000 kilobytes, and divide again we get 32125 megabytes. So the size of partition 3 is 32125 MB. Create the partition by:
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> create partition PRIMARY size=524
DiskPart succeeded in creating the specified partition.
DISKPART> format quick fs=ntfs
100 percent completed
DiskPart successfully formatted the volume.
Windows uses an id to identify Recovery partitions from normal NTFS partition, so we need to set the id of this partition to the id which represents a recovery drive. First get the id from the recovery partition on Disk 0:
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> detail partition
Partition 4
Type : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden : Yes
Required: Yes
Attrib : 0X8000000000000001
Offset in Bytes: 33808187392
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
* Volume 2 NTFS Partition 524 MB Healthy Hidden
Copy the UUID which is the "TYPE" of the partition, it should be de94bba4-06d1-4d40-a16a-bfd50179d6ac on Windows Server 2022 but may be different. Then set the UUID of the recovery partition on Disk 1:
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
DiskPart successfully set the partition ID.
DISKPART> detail partition
Partition 4
Type : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden : Yes
Required: No
Attrib : 0000000000000000
Offset in Bytes: 33808187392
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
* Volume 4 NTFS Partition 524 MB Healthy Hidden
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> convert dynamic
DiskPart successfully converted the selected disk to dynamic format.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> convert dynamic
DiskPart successfully converted the selected disk to dynamic format.
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> assign letter=q
DiskPart successfully assigned the drive letter or mount point.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> assign letter=z
DiskPart successfully assigned the drive letter or mount point.
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> remove
DiskPart successfully removed the drive letter or mount point.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> remove
DiskPart successfully removed the drive letter or mount point.
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> assign letter=p
DiskPart successfully assigned the drive letter or mount point.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> assign letter=s
DiskPart successfully assigned the drive letter or mount point.
Display the current BCD bootloader configuration using the following command:
When creating a mirror, VDS service has automatically added the BCD entry for the second mirror disk (labeled "Windows Server 2022 – secondary plex"). 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:
Then reboot and verify if there is a 'Windows Boot Manager Cloned' in your BIOS boot device list.
And check if boot option "Windows Server 2022 – secondary plex" boots.