• No results found

2 Use the Activate Spare (activatespare plug‐in) function to add it to the RAID 1 device as a  new mirror.

6.3.2

Adding Segments to a RAID 4 or 5

If the RAID region is clean and operating normally, the kernel driver adds the new object as a regular  spare, and it acts as a hot standby for future failures. If the RAID region is currently degraded, the  kernel driver immediately activates the new spare object and begins synchronizing the data and  parity information. 

6.4

Adding or Removing a Spare Disk

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. 

 Section 6.4.1, “Do You Need a Spare Disk?,” on page 90

 Section 6.4.2, “Adding a Spare Disk When You Create the RAID,” on page 91

 Section 6.4.3, “Adding a Spare Disk to an Existing RAID,” on page 91

 Section 6.4.4, “Removing a Spare Disk from a RAID,” on page 91

6.4.1

Do You Need a Spare Disk?

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 “Overview of RAID Levels” on page 80, 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.

6.4.2

Adding a Spare Disk When You Create the RAID

When you create a RAID 1, 4, or 5 in EVMS, specify the Spare Disk in the Configuration Options 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 5d in Section 6.2, “Creating and Configuring a Software RAID,” 

on page 85.

6.4.3

Adding a Spare Disk to an Existing 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. 

1 Prepare a disk, segment, or region to use as the replacement disk, just as you did for the  component devices of the RAID device.

2 In EVMS, select the Actions > Add > Spare Disk to a Region (the addspare plug‐in for the EVMS  GUI).

3 Select the RAID device you want to manage from the list of Regions, then click Next.

4 Select the device to use as the spare disk.

5 Click Add.

6.4.4

Removing a Spare Disk from a RAID

The RAID 1, 4, or 5 device can be active and in use when you remove its spare disk.

1 In EVMS, select the Actions > Remove > Spare Disk from a Region (the remspare plug‐in for the  EVMS GUI).

2 Select the RAID device you want to manage from the list of Regions, then click Next.

3 Select the spare disk.

4 Click Remove.