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
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.