11

I accidentally unplugged my eSATA cable while rerouting some cables behind my desk and knocked my RAID array offline.

I believe the drives are fine, but they show up as state "removed" now, how can I reinitialize the array?

mdadm --detail /dev/md1 shows:

/dev/md1:
        Version : 00.90
  Creation Time : Wed Oct 20 20:00:41 2010
     Raid Level : raid5
     Array Size : 5860543488 (5589.05 GiB 6001.20 GB)
  Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Mon Oct  3 18:39:41 2011
          State : clean, degraded
 Active Devices : 0
Working Devices : 0
 Failed Devices : 4
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       0        0        1      removed
       2       0        0        2      removed
       3       0        0        3      removed

       4       8       32        -      faulty spare
       5       8       48        -      faulty spare
       6       8       16        -      faulty spare
       7       8       64        -      faulty spare

And here's mdstat:

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid5 sdc[4](F) sdd[5](F) sdb[6](F) sde[7](F)
      5860543488 blocks level 5, 64k chunk, algorithm 2 [4/0] [____]

unused devices: <none>
Jorge Castro
  • 71,754

1 Answers1

13

It looks a bit like you managed to knock off all four drives from the array? I think you get some kind of achievement badge. :-)

You should be able to just re-add them to the array:

sudo mdadm /dev/md1 --re-add /dev/sd[bcde]

Then watch cat /proc/mdstat to see it rebuild them.

See man mdadm for more.

poolie
  • 9,241
  • 2
    Run watch cat /proc/mdstat for a live status on the rebuild. I'll warn you: it's like watching paint dry. – Oli Oct 04 '11 at 12:21
  • 1
    Lies! Watching cat /proc/mdstat is a past-time of mine. It's especially great if you do "-d" and "-n 0.1". – popey Oct 04 '11 at 20:23