Fedora's RAID-1: how to recover from a crash?
Hello everyone,
I have installed Fedora Core 1 and Core 3 on my servers and, in all installations, I'm using software RAID-1. I usually configure four partitions: /dev/md0 ==> /boot /dev/md1 ==> / /dev/md2 ==> /var /dev/md3 ==> swap Well, after a long time feeling secure, one of the hard disks of one of the servers crashed. So I shut the server down, removed the crashed HD, turned the server on with the remaining HD, and, to my dismay, it didn't work. The remaining HD was corrupted. Did I do something wrong? What should I do in the case of a crash? By the way, the HDs are not hot-pluggable. Thanks, Juliano Pastorino |
Partition the new drive to match the old drive, then start each array (for example):
/sbin/mdadm /dev/md0 --fail /dev/hda1 --remove /dev/hda1 /sbin/mdadm /dev/md0 --add /dev/hda1 You can check the status of the array with: cat /proc/mdstat or /sbin/mdadm -D /dev/md0 |
Hi macemoneta,
Thanks a lot for your help. Just to be sure, I would like to know if I should follow the steps below: 1) When I notice that a HD has failed, I first execute: /sbin/mdadm /dev/md0 --fail /dev/hda1 --remove /dev/hda1 for each partition. 2) Then I turn off the server, remove the old HD, install de new HD, and turn on the server. 3) Then I partition the new HD, and execute: /sbin/mdadm /dev/md0 --add /dev/hda1 for each partition. Is that correct? Thanks, Pastorino |
That'll do it. Make sure you have the mdadm command installed on your distribution. If not, the old (pre-mdadm) way was with:
/sbin/raidhotremove /dev/md0 /dev/hda1 ... /sbin/raidhotadd /dev/md0 /dev/hda1 Either way will work, but using the mdadm command is preferred. |
All times are GMT -5. The time now is 12:44 PM. |