Everything listed below can be found in the (incredibly long) mdadm man page.
Don’t blindly use the following commands. Be sure you understand what they do before you proceed.
With md1 and md2 unmounted:
Code:
# # Verify that md1 and md2 are synced and clean
#
# mdadm -D /dev/md1 # OR “cat /proc/mdstat”
# e2fsck -f /dev/md1 # OR fsck whatever type of filesystem you are using
#
# # Stop and recreate raid1
#
# mdadm -S /dev/md1
# mdadm -C /dev/md1 -l1 -n2 /dev/sda1 missing
# e2fsck -f /dev/md1 # OR fsck whatever type of filesystem you are using
#
# # Then mount md1 and verify that the contents look OK.
# # If md1 looks fine, then:
#
# mdadm /dev/md1 -a /dev/sdc1
# cat /proc/mdstat
#
# # If md1 does not look correct, then unmount it and:
#
# mdadm -S /dev/md1
# mdadm -A --run /dev/md1 /dev/sdc1
# e2fsck -f /dev/md1 # OR fsck whatever type of filesystem you are using
# mdadm /dev/md1 -a /dev/sda1
# cat /proc/mdstat
And likewise for md2 after md1 is rebuilt.
As a warning, I don’t recall doing this on a real filesystem, but since the partitions are already set up for software raid1, the recreation should work fine. As always, be sure to back up everything before you start.