Rebuilding failed drive in linux md raid

A drive in an Linux md raid array is failed and replaced.
As md raid will not rebuild your array by itself something needs to be done.

Using mdadm, it goes like this:
mdadm - -add /dev/mdX /dev/sdaY
where /dev/mdX is the array that has a failed member, and /dev/sdaX is a partition that needs to be added.

/dev/sda needs to be partitioned before though.

Then it is only a matter of time to see Your arrays being syncronized.
watch -n1 'cat /proc/mdstat'
That array can be in use during that syncronization process.

If You know, that a device, shown as failed should be ok and want to add it back to a md device, it must be removed first:
mdadm --remove /dev/mdX /dev/sdbY
and then added as described before.

Leave a comment

Your email address will not be published. Required fields are marked *