Originally Posted by atarghe1
... has anyone been successful in recovering from a single drive failure using an mdadm RAID 5? If so, what was the procedure?
Recently went through the same thing here, a drive in our Raid-5 array was marked faulty. Further investigation revealed the drive was really quite dead. Although Google wasn't very helpful, the procedure turned out to be rather straight forward in the end.
1. Use "mdadm --manage /dev/md0 -r /dev/sdd" to remove the drive that was marked as faulty from the array.
2. Power down and replace the drive with a good drive.
3. Power up and set the partition table on the new drive to match those of the other drives in the array. Here we used "sfdisk -d /dev/sda | sfdisk /dev/sdd".
4. Add the proper partition on the new drive into the array, "mdadm --manage /dev/md0 -a /dev/sdd2"
5. Sit back and wait for the recovery to happen, you can "cat /proc/mdstat" to watch its progress; you should see something like:
Personalities : [raid5]
md0 : active raid5 sdd2 sdc2 sdb2 sda2
731985408 blocks level 5, 256k chunk, algorithm 2 [4/3] [UUU_]
[===>.................] recovery = 19.7% (48253056/243995136) finish=59.1min speed=55184K/sec
You can get more detailed instructions for Raid 1 here:
www dot howtoforge dot com/replacing_hard_disks_in_a_raid1_array
Essentially the same steps as for Raid 5 which worked here.
Hope this helps,