If you make raid for boot disk with linux software raid (mdadm) and one disk failed, this is how you have to do for replace failed disk and boot the system.

first if failed disk is first hard drive (sda for example) you have to make sure that mirror disk can boot so you have to setup grub on mirror disk (sdb)

mysystem# grub
Grub>device (hd0) /dev/sdb
Grub>root (hd0,0)
Grub>setup (hd0)

and check /etc/grub.conf on mirror disk (sdb) is set correctly

remove failed disk from raid device.

mysystem#mdadm --manage /dev/md0 --fail /dev/sdb1 (up to your raid configuration)
mysystem#mdadm --manage /dev/md1 --remove /dev/sdb2

remove failed disk from all raid (md0,md1,md2 ..)

now shutdown the system and replace failed disk with new one.

reboot the system, if system is boot up without error you can add new disk to raid array.

make replaced disk (sda) the same partition like boot disk (sdb)

mysystem#sfdisk -d /dev/sdb | sfdisk /dev/sda

then add new disk to raid array

mysystem#mdadm --manage /dev/md0 --add /dev/sda1 (repeat for every partitions)

check raid status

mysystem#cat /proc/mdstat

wait until resync process is finish,if everything ok you can use the system.

แสดงความคิดเห็น