Hello,
I have a failed primary ( /dev/sda ) boot drive. I am running in a mirror raid
/dev/sda and /dev/sbc
Device Boot Start End Blocks Id System
/dev/sdc1 1 45 358400 fd Linux raid autodetect
/dev/sdc2 46 108 506047+ 82 Linux swap / Solaris
/dev/sdc3 109 30401 243325601 fd Linux raid autodetect
sda/c1 is /boot
sda/c3 is / (OS )
I have replaced failed drives in raid in the past, but not the primary.
QUESTIONS:
1) do I need to set sdc1 bootable flag ?
2) does grub need to be changed? HD0,0 need to be changed ?
If so, I am not up on how to know what it would be. I am thinking ( hd2,0 )
3) is SATA drive hotswappable ?
# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb1[0] sdd1[1]
976759936 blocks [2/2] [UU]
md1 : active raid1 sda3[2](F) sdc3[1]
243325504 blocks [2/1] [_U]
md0 : active raid1 sda1[2](F) sdc1[1]
358336 blocks [2/1] [_U]
unused devices: <none>
[11:30 PM]root [system_info]# fdisk -l /dev/sda
nothing returned
---------- Post added 2010-04-03 at 10:55 AM CDT ---------- Previous post was 2010-04-02 at 11:36 PM CDT ----------
My thinking is I need to bring down the server replace drive and boot backup. My question is the best way to bootup on the secondary drive.
One thing I am sure on is the boot flag needs to be set in fdisk. ( I like fdisk )
And grub needs to be changed to look at '/dec/sdc drive. Or is it easier to set boot on /dev/sdc then power down switch cable making sdc now my sda drive, placing new drive as sdc ?
---------- Post added at 10:48 PM CDT ---------- Previous post was at 10:55 AM CDT ----------
Here is what I did
Set boot flag to /dev/sdc1
I was able to hotswap the failed drive , but it was labeled sdf, not sda
From GRUB prompt ran
find /grub/stage1
this told me where I can boot from
update grub.conf
Rebuilt my partitions
then restored my raid
mdadm /dev/md0 --add /dev/sdf1
edit/remove raid info from /etc/mdadm.conf
rebuild mdadm.conf
mdadm --detail --scan >> /etc/mdadm.conf ( best to do when rebuild completes )
REBOOT FAILED
switch cables around
booted up in rescue mode
changed grub.conf back to (hd0,0)
went to grub prompt
ran
grub root (hd0,0)
grub setup (hd0)
exit grub prompt
ran
grub-install /dev/sda
Not sure if I needed to run both grub setup and grub-install, but did
rebooted, all is good