Assembling: mdadm the wrong way

I migrated my external JBoD enclosure over to a different PC this morning thinking I’d sort out the music collection a bit in preparation for the holiday travels.  I happily logged in from work and fired off what I thought was the appropriate command to assemble my software RAID-5:

mdadm --assemble /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/md0

NOPE!  That /dev/md0 is supposed to be the first directive after the –assemble

e.g.

mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

I was a bit concerned to see errors telling me I no longer had a valid superblock on /dev/sda1 when I tried to correct –assemble syntax.

mdadm: no RAID superblock on /dev/sda1
 mdadm: /dev/sda1 has no superblock - assembly aborted

mdadm -E would show RAID block information for all of the other drives, but not for /dev/sda1

I was preparing myself for rebuilding the RAID-5.  Concerned, of course, that I not further break things or risk compromising a “good” drive and the chance at a “healthy” RAID.

Attempting this suggestion to assemble the RAID with 3 of the 4 drives and then re-add my bad /dev/sda1 didn’t work.

If at first you don’t succeed (don’t panic) and Google again.

That led me to this thread and the comforting post:

oops

So turns out I didn’t erase the superblocks, I just destroyed the device files in /dev. If I had erased the superblock then the create method above would have fixed it, instead a reboot did the trick.

Sure enough, a reboot (I didn’t have the patience at this point to manually rebuild my /dev/sda1) and I was back in business.  No degraded RAID and no damage done (except to my head from smacking it).
Lesson: Measure syntax twice.  mdadm once!

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>