Replace a failed disk in RAID
You can reconstruct the data from the failed disks by using the remaining disks. RAID level and the total number of disks determines the minimum amount of remaining disks needed for a successful data reconstruction.
Before you begin
- A spare disk for replacement.
- The
mdadmpackage is installed.
About this task
In this procedure, the /dev/md0 RAID contains four disks. The /dev/sdd disk has failed and you need to replace it with the /dev/sdf disk.
Procedure
Results
- Check the details of the array:
# mdadm --detail /dev/md0If this command shows a list of disks in the /dev/md0 RAID where the new disk has spare rebuilding status at the end of the output, data is still being copied to it from other disks:
Number Major Minor RaidDevice State 0 8 16 0 active sync /dev/sdb 1 8 32 1 active sync /dev/sdc 4 8 80 2 spare rebuilding /dev/sdf 3 8 64 3 active sync /dev/sdeAfter data copying is finished, the new disk has an active sync status.
- Check the progress of synchronization:
# cat /proc/mdstatPersonalities : [raid4] [raid5] [raid6] md0 : active raid5 sdf[5] sde[4] sdc[1] sdb[0] 6282240 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UU_U] [==============>......] recovery = 72.0% (1509820/2094080) finish=0.0min speed=215688K/sec unused devices: <none>