Hi!
I originally had a software RAID-1 setup with two disk. Unfortunately, I discovered (too late) that GRUB was not configured properly and was only booting off of the first disk, hd0 (i.e. /dev/sda). Guess which disk failed on me?
I fixed the above mess, and now I want to add a third drive, /dev/sdc, to my working software RAID-1 as a spare. Please give me a sanity check on this as well as telling me if I added extra steps that are not needed:
First I copied the partition table to my new drive:
sfdisk -d /dev/sda | sfdisk /dev/sdc
This gave me /dev/sdc1 as type fd (Linux raid autodetect).
I then added /dev/sdc1 to my raid:
mdadm --add /dev/md0 /dev/sdc1
I look at /proc/mdstat and see sdc1[2](S) meaning that the spare has been added.
Finally, I create a new /etc/mdadm.conf using:
mdadm --examine --scan > /etc/mdadm.conf
Now to deal with GRUB. I want to be able to boot off of any of the three disks that are now in my software RAID-1. After editting, the top of my /boot/grub/menu.1st file has:
default=0
fallback=1 2
timeout=5
I also added a third kernel stanza by copying the previous stanza and changing the root line to read:
root (hd2,0)
Finally, I generated a new ramdisk using:
mkinitrd /boot/initrd-`uname -r`.img `uname -r`
Before adding the spare, I installed the GRUB bootloader on the first and second drives, hd0 and hd1 respectively.
Do I need to install the bootloader on the spare as well or will that be copied if the spare is activated and the array is rebuilt? Is there anything else I need to do?
Thanks!