Windows 7 / Getting Started

Mirroring Boot and System Volumes

Disk mirroring is often used to mirror boot and system volumes. Mirroring these volumes ensures that you'll be able to boot the server in case of a single drive failure.

Mirroring Boot and System Volumes on MBR Disks

When you want to mirror boot or system volumes on MBR disks, the process is fairly straightforward. You start with two disks, which I'll call Disk 0 and Disk 1, where Disk 0 has the system files and Disk 1 is a new disk. The system disk is typically a basic disk that must be upgraded to a dynamic disk before you can mirror it-mirroring is only possible on dynamic disks.

To begin, upgrade Disk 0 to a dynamic disk and then upgrade Disk 1. In Disk Management, right-click the boot or system volume that you want to mirror, and then select Add Mirror. This displays the Add Mirror dialog box. Select the disk onto which you want to add the mirror (Disk 1 in the example), and then click Add Mirror. Windows Server 2008 begins the mirror creation process, and you'll see a status of Resynching on both volumes. When the resynching is complete, the status should change to Healthy.

During the creation of the mirror, the operating system should add an entry to the system's Boot Manager that allows you to boot to the secondary mirror. Resolving a primary mirror failure is much easier with this entry in the Boot Manager file than without it because all you need to do is select the entry to boot to the secondary mirror. If you mirror the boot volume and a secondary mirror entry is not created for you, you could modify the boot entries in the Boot Manager to create one using the BCD Editor (bcdedit.exe).

If a system fails to boot to the primary system volume, restart the system and select the Boot Mirror - Secondary Plex option for the operating system you want to start. The system should start up normally. After you successfully boot the system to the secondary drive, you can schedule the maintenance necessary to rebuild the mirror if desired.

Mirroring Boot and System Volumes on GPT Disks

Mirroring boot and system volumes on GPT disks isn't the same as for MBR disks. Primarily, this is because GPT disks used to boot the operating system have an ESP and an MSR partition that must be created on the disk in a certain order. Thus, to mirror boot and system volumes on GPT disks, you must create the necessary partitions on the second disk of the mirrored set and tell the operating system that these partitions can be used for booting.

Note: As stated previously, not all computers are capable of booting to GPT disks. Only computers with EFI can boot to GPT disks.

To get started, you need two disks that use the GPT partition style and the basic storage type. One of the disks should already be designated as the boot volume. Refer to this volume as Disk 0. The other disk should be identical in size or larger than the boot volume. Refer to this volume as Disk 1. Disk 1 should be a clean disk, meaning it can't already have partitions on it; so, if necessary, copy any data on the disk to another disk or make a backup of the data and then delete any existing partitions. You can use Disk-Part to do this by completing the following steps:

  1. At the command prompt, invoke DiskPart by typing diskpart. List the disks available on the system by typing list disk.
  2. Select the disk you are going to use as the secondary boot disk. Following the example, this is Disk 1, so you would type select disk 1.
  3. List the partitions on this disk by typing list partition.
  4. If there are any existing partitions, select and delete each partition in turn. For example, if the disk had Partition 1, you'd type select partition 1, and then type delete partition override. The Override parameter ensures that you can delete nonuser partitions.

After you've made sure the second disk doesn't contain any partitions, list the available disks again by typing list disk, then select the disk you are going to use as the current boot disk. Following the example, this is Disk 0, so you would type select disk 0. List the partitions on this disk by typing list partition. The output you'll see will be similar to the following:

Partition ###  Type        Size        Offset
-------------  ----------------------- -------
Partition 1    System       316 MB     32 KB
Partition 2    Primary     9992 MB     312 MB
Partition 3    Reserved      32 MB     9 GB

The output shows you which partitions are being used as the ESP and MSR partitions. The ESP is listed with the partition type System. The MSR partition is listed with the partition type Reserved. Note the size of each partition. Here, System is 316 MB and Reserved is 32 MB.

You now must create the ESP and the MSR partition on the second disk by completing the following steps:

  1. In DiskPart, select this disk to give it focus. Following the example, you'd type select disk 1.
  2. Afterward, you would create the ESP first by typing create partition efi size=N, where N is the size previously noted, such as size=316.
    Note: The target disk must still be basic at this point. If you already converted the disk to dynamic, then steps 2 and 3 will result in errors.
  3. Create the MSR partition by typing create partition msr size=N, where N is the size previously noted, such as size=32.
  4. If you type list partition, you should see that both partitions have been created and are sized appropriately, such as follows:
    Partition ###   Type 		Size 	 Offset
    -------------   -----------------------  -------
    Partition 1     System 		316 MB 	 32 KB
    Partition 2 	Reserved 	32 MB 	 316 MB
    

Next you must prepare the ESP for use by assigning it a drive letter, formatting it, and copying over the necessary startup files from the current boot volume. To do this, follow these steps:

  1. In DiskPart, select the partition by typing select partition 1.
  2. Assign a drive letter by typing assign letter=X, where X is the drive letter, such as letter=H.
  3. Format the ESP as FAT. Following the example, you'd type format /fs=fat quick.
  4. After formatting is complete, select the current boot volume. Following the example, you'd type select disk 0.
  5. Type select partition 1 to select the ESP on the current boot volume.
  6. Assign this partition a drive letter by typing assign letter=X, where X is the drive letter to assign, such as letter=I.
  7. Exit DiskPart by typing exit.
  8. Use the Xcopy command to copy all the files from the ESP on the current boot volume to the ESP on the second disk. Following the example, you'd type xcopy i:\*.* h: /s /h. The /s and /h parameters ensure that hidden system files are copied.

You now must convert both drives to the dynamic storage type. Start with the second disk and then convert the current boot disk. Follow these steps:

  1. Invoke DiskPart by typing diskpart.
  2. Select the disk you are going to use as the secondary boot disk. Following the example, this is Disk 1, so you would type select disk 1.
  3. Convert the disk by typing convert dynamic.
  4. Select the current boot disk. Following the example, this is Disk 0, so you would type select disk 0.
  5. Convert the disk by typing convert dynamic.
  6. Exit DiskPart by typing exit.
  7. You must shut down and restart the computer to complete the conversion process for the current boot disk. In some cases, this process takes several reboots to complete.
:Note You don't have to delete the drive letters assigned in the previous procedure. These drive letters will not be reassigned after the restart.

When the conversion process is complete, log on to the system, and then follow these steps to mirror the boot drive:

  1. Invoke DiskPart by typing diskpart.
  2. Select the current boot disk. Following the example, this is Disk 0, so you would type select disk 0.
  3. Add the disk to use as the second drive to this volume to create the mirrored set. Following the example, you'd type add disk=1.
    DiskPart will then begin the mirror creation process by synchronizing the data on both volumes.

During the creation of the mirror, the operating system should add an entry to the system's Boot Manager that allows you to boot to the secondary mirror. Resolving a primary mirror failure is much easier with this entry in the Boot Manager file than without it because all you need to do is select the entry to boot to the secondary mirror. If you mirror the boot volume and a secondary mirror entry is not created for you, you could modify the boot entries in the Boot Manager to create one using the BCD Editor (bcdedit.exe).

If a system fails to boot to the primary system volume, restart the system and select the Boot Mirror - Secondary Plex option for the operating system you want to start. The system should start up normally. After you successfully boot the system to the secondary drive, you can schedule the maintenance necessary to rebuild the mirror if desired. Now if you shut down the system and restart, you should be able to boot successfully to either the primary or secondary boot disk.

[Previous] [Contents] [Next]