Raid

From Vlsiwiki
Revision as of 07:39, 3 March 2010 by Tom Golubev (Talk | contribs) (Created page with 'What if your raid array ejected one or more RAID drives? If you know that the drive(s) is good, you can force the drive back into the array. Some google links claim they can …')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What if your raid array ejected one or more RAID drives?

If you know that the drive(s) is good, you can force the drive back into the array.

Some google links claim they can recreate the array after zeroing the superblocks on all devices, but that is risky.

I have been successfull in fixing this problem once before. Two sata cables got knocked out the mdadm software raid 5 array was inoperable. Executing an ls command resulted in an "IO error unable to read". Insert big explatives everywhere.

All partitions in a particular raid array have a raid superblock towards the end of the physical partition. When drives get ejected, only the 'still good ones' have updated metadata (superblock).

The ejected drives' metadata is still intact, and in fact 'golden'. We will use this metadata, and port the good parts (the mapping of which drives go where and whether they are good) into the drives still remaining in the raid array.

Tip 1: Boot FC11 LiveCD, change root pw, start sshd, go home.

Process:

  Find / backup metadata of each drive 
  Copy parts of 'golden' into remaining raid drives
  Restart the drives using fdisk (Optional?)


    • Find / backup metadata of each drive **
 using bash, lets find the metadata and back it up.
   size=$(blockdev --getsize /dev/hda1)
   meta=$(( ($size & -128) - 128 ))
   Then use this dd command to backup the metadata
   dd if=/dev/hda1  bs=512 count=128 seek=$meta of=hda1_orig-bad_raid_metadata

Assuming all drives are EXACTLY the same, model and lot, as newer drives can have slightly different sizes.

Backup all the drives by tweaking the if and of of the above dd command