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.

link|improve this question

What fails, precisely: -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 does mdadm -D /dev/md2 show? (Expected: spare rebuilding /dev/sdb1, becoming active sync /dev/sdb1 once the rebuilding is finished.) – Gilles Dec 3 '10 at 19:14
Any resolution for this? – belacqua Jan 28 '11 at 2:57
@Gilles the -A thinks sdb is a spare, not a data drive, so the --run won't happy. – Kees Cook Jan 28 '11 at 22:10
feedback

1 Answer

You're using -A which is --assemble, but you should be using -a which is --add.

If I recall correctly, devices (re)added to an existing array are always added as spares, then shortly afterwards the kernel will pick up that the array is both degraded and has a spare, and then it will start re-mirroring. You can see this with watch /proc/mdstat.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.