In an effort to clean up from a software bug in md, I marked half of a RAID (/dev/sda1 and /dev/sdb1 in RAID1) as faulty using:
mdadm /dev/md2 --fail /dev/sdb1
mdadm /dev/md2 --remove /dev/sdb1
But now I want to use the "failed" half instead. i.e. instead of using /dev/sda1, I want to use /dev/sdb1, but mdadm refuses to bring it online:
mdadm --stop /dev/md2
mdadm -A /dev/md2 /dev/sdb1 --run --force
This fails, as it considers /dev/sdb1 a "spare" and not an actual member of the array any more.
-A, or--run? (They're separate operations and can be performed in either order, unless this is relevant to your bug recovery). What is the exact error message? What doesmdadm -D /dev/md2show? (Expected:spare rebuilding /dev/sdb1, becomingactive sync /dev/sdb1once the rebuilding is finished.) – Gilles Dec 3 '10 at 19:14-Athinkssdbis a spare, not a data drive, so the--runwon't happy. – Kees Cook Jan 28 '11 at 22:10