Koozali.org: home of the SME Server

RAID-1 Recovery

Nathan Fowler

RAID-1 Recovery
« on: May 23, 2001, 01:29:18 AM »
If a RAID-1 array is broken due to drive failure how do you go about re-creating the array?  I've looked at the RAID How-to however it seems that E-SMITH handles RAID a bit differently.  I'm suprized this question hasn't be asked before.

As an FYI I did 1 hour worth of indepth research before posting this question, this is a last-ditch effort.  Any information is appreciated.

Thanks.

Nathan

Nathan Fowler

Re: RAID-1 Recovery
« Reply #1 on: May 23, 2001, 01:40:52 AM »
Might I add that I may have brought this on myself, I noticed that the boot device in /etc/lilo.conf was set as /dev/hda, I changed it to /dev/md0 so I could boot from either drive in case of a failure.  When booting it "kicks hda" out because the super-block on /dev/hdc is newer.

Nathan Fowler

Re: RAID-1 Recovery
« Reply #2 on: May 23, 2001, 02:18:35 AM »
To answer my own question:
Power down the system
Replace the failed disk
Power up the system once again.
Use raidhotadd [array] [partition] to re-insert the disk in the array
Have coffee while you watch the automatic reconstruction running

Example:  raidhotadd /dev/md2 /dev/hda1

Make sure you "cat /proc/mdstat" to make sure you align the partition to the correct array.  IE:  If you see md0 : active raid1 hdc5[1] xxx blocks [2/1] [_U]
and hda is your failed drive not in the array do a "raidhotadd /dev/md0 /dev/hda5".

It may take a while to resync so check on the status by doing a "cat /proc/mdstat |grep recovery" and keep an eye out on the percentages.

Special thanks to the E-smith team for providing us all with such a great tool and distribution.  Hopefully this will help you guys out there, it took me a while to find it.