5.9.9.2. Rebuilding a RAID array

Should /proc/mdstat show that a problem exists with one of the RAID arrays, you can rebuild it by performing the following steps:
  1. Remove the disk from the raid array.
    mdadm --manage /dev/md0 -r /dev/sdc3
  2. Remove the disk from the system.
  3. Using fdisk, replace the removed disk and re-format the replacement disk.
  4. Add the new disk back to the RAID array.
    mdadm --manage /dev/md0 -a /dev/sdc3
  5. To restore the disk, perform a "software fail" the previous spare slice:
    mdadm --manage --set-faulty /dev/md0 /dev/sdc3
  6. The system will now attempt to rebuild the array on the replaced disk. Use the following command to monitor status:
    watch -n 1 cat /proc/mdstat
  7. When the array is finished rebuilding, remove and then re-add the software-failed disk back to the array.
    mdadm --manage /dev/md0 -r /dev/sdc3
    mdadm --manage /dev/md0 -a /dev/sdc3
  8. Check the array.
    mdadm --detail /dev/md0