The MD driver allows you to optionally designate a spare disk (device, segment, or region) for RAID 1, 4, and 5 devices. You can assign a spare disk when you create the RAID or at any time thereafter. The RAID can be active and in use when you add or remove the spare. The spare is activated for the RAID only on disk failure.
The advantage of specifying a spare disk for a RAID is that the system monitors the failure and begins recovery without human interaction. The disadvantage is that the space on the spare disk is not available until it is activated by a failed RAID.
As noted in Section 6.1.2, “Overview of RAID Levels”, RAIDs 1, 4, and 5 can tolerate at least one disk failure. Any given RAID can have one spare disk designated for it, but the spare itself can serve as the designated spare for one RAID, for multiple RAIDs, or for all arrays. The spare disk is a hot standby until it is needed. It is not an active member of any RAIDs where it is assigned as the spare disk until it is activated for that purpose.
If a spare disk is defined for the RAID, the RAID automatically deactivates the failed disk and activates the spare disk on disk failure. The MD driver then begins synchronizing mirrored data for a RAID 1 or reconstructing the missing data and parity information for RAIDs 4 and 5. The I/O performance remains in a degraded state until the failed disk’s data is fully remirrored or reconstructed.
Creating a spare-group name allows a single hot spare to service multiple RAID arrays. The spare-group name can be any character string, but must be uniquely named for the server. For mdadm to move spares from one array to another, the different arrays must be labelled with the same spare-group name in the configuration file.
For example, when mdadm detects that an array is missing a component device, it first checks to see if the array has a spare device. If no spare is available, mdadm looks in the array’s assigned spare-group for another array that has a full complement of working drives and a spare. It attempts to remove the spare from the working array and add it to the degraded array. If the removal succeeds but the adding fails, then the spare is added back to its source array.
When you create a RAID 1, 4, or 5 in EVMS, specify the in the dialog box. You can browse to select the available device, segment, or region that you want to be the RAID’s spare disk. For information, see Step 5.d in Section 6.2, “Creating and Configuring a Software RAID”.
The RAID 1, 4, or 5 device can be active and in use when you add a spare disk to it. If the RAID is operating normally, the specified disk is added as a spare and it acts as a hot standby for future failures. If the RAID is currently degraded because of a failed disk, the specified disk is added as a spare disk, then it is automatically activated as a replacement disk for the failed disk, and it begins synchronizing the data and parity information.
Prepare a disk, segment, or region to use as the replacement disk, just as you did for the component devices of the RAID device.
In EVMS, select the (the addspare plug-in for the EVMS GUI).
Select the RAID device you want to manage from the list of Regions, then click .
Select the device to use as the spare disk.
Click .