6.5 Configuring RAID 1: Disk mirroring
For RAID 1, disk
mirroring, you configure two volumes on two drives identically. Data is
written to both drives. If one drive fails, there is no data loss
because the other drive contains the data. After you repair or replace
the failed drive, you can restore full mirroring so that the volume is
once again fault tolerant.
By using disk mirroring, you gain the advantage of redundancy. Because disk mirroring doesn’t write parity information, mirrored
volumes can usually offer better write performance than disk striping
with parity. The key drawback, however, is that disk mirroring has a 50
percent overhead, meaning it effectively cuts the amount of storage
space in half. For example, to mirror a 750-GB drive, you need another
750-GB drive. That means you use 1500 GBs of space to store 750 GBs of
information.
As with disk striping, you’ll often want the mirrored disks to be on
separate disk controllers. This provides redundancy for the disk
controllers. If one of the disk controllers fails, the disk on the other
controller is still available. When you use two separate disk
controllers to duplicate data, you’re using a technique known as disk duplexing rather than disk mirroring—but why mince words?
You can create a mirrored set either by using two new disks or by
adding a mirror to an existing volume. As with other RAID techniques,
mirroring is transparent to users. Users see the mirrored set as a
single volume that they can access and use like any other drive.
Creating a mirrored set using two new disks
To create a mirrored set using two new disks, start Disk Management.
In Graphical View, press and hold or right-click an area marked
Unallocated on a dynamic disk and then choose New Mirrored Volume. This
starts the New Mirrored Volume Wizard. Tap or click Next. Create the
volume . The key difference is that you must create two identically sized volumes
and these volumes must be on separate dynamic drives. The volumes can
be formatted as FAT, FAT32, exFAT, NTFS, or ReFS. You won’t be able to
continue past the Selected Disks page until you select the two disks
that you want to work with.
When you tap or click Finish, you’ll return to the main Disk Management window, and Disk Management will create the mirrored
set. During the creation of the mirror, you’ll see a status of
Resynching. This tells you that Disk Management is creating the mirror.
When this process finishes, you’ll have two identical volumes. Both
volumes will show the same drive letter in Disk Management, but the
separation of volumes is transparent to users. Users see the mirror set
as a single volume. The volume status should be listed as Healthy. This
is the normal status for volumes. If the status changes, you might need
to repair or resync the mirrored set.
Adding a mirror to an existing volume
You can also use an existing volume to create a mirrored set. For
this to work, the volume you want to mirror must be a simple volume and
you must have an area of unallocated space on a second dynamic drive
with an equal or larger amount of space than the existing volume. When
you add a mirror onto this unallocated space, Disk Management creates a
volume that is the same size and file-system type as the simple volume
you are mirroring. It then copies the data from the simple volume to the new volume using a process called resynching.
To add a mirror to an existing volume, start Disk Management. In
Graphical View, press and hold or right-click the simple volume you want
to mirror and then select Add Mirror. This displays the Add Mirror
dialog box. Use the Disks list to select a location for the mirror, and
then tap or click Add Mirror. Windows Server 2012 begins the mirror
creation process, and you’ll see a status of Resynching on both volumes.
When the resynching is complete, you have two identical copies of the
original volume. Although both volumes show the same drive letter in
Disk Management, the separation of volumes is transparent to users.
Users see the mirror set as a single volume.
6.6 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 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 possible only on dynamic disks.
To begin, upgrade Disk 0 to a dynamic disk and then upgrade Disk 1 . In Disk Management, press and hold or
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 tap or click Add Mirror. Windows Server 2012 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 EFI-based computers 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.
I’ll refer to this volume as Disk 0. The other disk should be identical
in size or larger than the boot volume. I’ll 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 DiskPart to do this by completing the following steps:
-
At the command prompt, invoke DiskPart by typing diskpart. List the disks available on the system by typing list disk
. -
Select the disk you are going to use as the secondary boot disk. Following the example, this is Disk 1, so you type select disk 1. -
List the partitions on this disk by typing list partition. -
If there are any existing partitions, select and delete each
partition in turn. For example, if the disk has Partition 1, you type select partition 1, and then type delete partition override. The Override parameter ensures that you can delete nonuser partitions.
After you make sure the second disk doesn’t contain any partitions, list the available disks again by typing list disk, and then select the disk you are going to use as the current boot disk. Following the example, this is Disk 0, so you 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 MBs and Reserved is 32 MBs.
You now must create the ESP and MSR partitions on the second disk by completing the following steps:
-
In DiskPart, select this disk to give it focus. Following the example, you type select disk 1. -
Afterward, you 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, steps 2 and 3 will result in errors.
-
Create the MSR partition by typing create partition msr size= N
, where N is the size previously noted, such as size=32. -
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:
-
In DiskPart, select the partition by typing select partition 1. -
Assign a drive letter by typing assign letter= X
, where X is the drive letter, such as letter=H. -
Format the ESP as FAT. Following the example, you type format /fs=fat quick. -
After formatting is complete, select the current boot volume. Following the example, you type select disk 0
. -
Type select partition 1 to select the ESP on the current boot volume. -
Assign this partition a drive letter by typing assign letter=X
, where X is the drive letter to assign, such as letter=I. -
Exit DiskPart by typing exit. -
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 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:
-
Invoke DiskPart by typing diskpart. -
Select the disk you are going to use as the secondary boot disk. Following the example, this is Disk 1, so you type select disk 1. -
Convert the disk by typing convert dynamic. -
Select the current boot disk. Following the example, this is Disk 0, so you type select disk 0. -
Convert the disk by typing convert dynamic
. -
Exit DiskPart by typing exit. -
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:
-
Invoke DiskPart by typing diskpart. -
Select the current boot disk. Following the example, this is Disk 1, so you type select disk 0. -
Add the disk to use as the second drive to this volume to create the mirrored set. Following the example, you 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 it, you should be able to
boot successfully to either the primary or secondary boot disk.
|