In this example we can see the status of the mirror is degraded and the only active drive is 'ad4'.
To find out which drives are available and the corresponding device name run the atacontrol list command.
# atacontrol list
This will produce a list of drives with device names which are connected to your server.
ATA channel 2: Master: ad4 <WDC WD1602ABKS-18N8A0/02.03B04> SATA revision 2.x Slave: no device present ATA channel 3: Master: ad6 <WDC WD2502ABYS-02B7A0/02.03B03> SATA revision 2.x Slave: no device present
From this we can see that device '*ad6*' is the device name of the new drive we can use to rebuild the mirror. You should already be aware of the device name from alerts generated by your server when the drive failed; the replacement drive will show up with the same device name.
Step 2 - Rebuild Mirror
Now that we have verified device name of the new drive we can easily rebuild the array using the following commands:
We can see here the new drive has been added and the mirror is being rebuilt (3% complete). Rebuild times can take anywhere from 20 minutes to a few hours depending on the size of the drives and the amount of application I/O on your system.
The first few lines show that overall state of the mirror, once the state changes from 'DEGRADED' to 'COMPLETE' the rebuild is complete.