Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|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

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 cat /proc/mdstat.

share|improve this answer
You forgot the cat in the watch command. I can't add this because edits have to be at least 6 characters... – leemes Nov 21 '12 at 21:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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