[NBLUG/talk] Software Raid - Proper method to replace a failing drive.

Mark Street jet at sonic.net
Wed Mar 9 00:09:02 PST 2011


Hi,

I have an older 1 U with 4 drives in a RAID array running CentOS 5.*.

One of the drives is starting to fail /dev/sdd so I need to replace 
it...  It is a bit different than hardware raid as I need to use the 
mdadm commands.

sdd1 is a boot partition = RAID 1
sdd2 is a swap partition = RAID 1
sdd3 is a root partition = RAID 5

It has been a long time since I have done this with software raid so I 
am asking for some critique of my written method.

1.  Make sure disk is not present in any arrays.

mdadm --fail /dev/md0 /dev/sdd1
mdadm --fail /dev/md1 /dev/sdd2
mdadm --fail /dev/md2 /dev/sdd3

2.  Hotswap drive /dev/sdd or shutdown machine and replace drive /dev/sdd

3.  Add the drive back to the array

mdadm --add /dev/md0 /dev/sdd1
mdadm --add /dev/md1 /dev/sdd2
mdadm --add /dev/md2 /dev/sdd3

4.  Let it rebuild and wait...

Does that sound like a sane method?



More information about the talk mailing list