-   Linux - Server (
-   -   How do I boot from a RAID-1 survivor? (

mackdav 03-26-2007 10:44 AM

How do I boot from a RAID-1 survivor?
Hi folks,

I just had a disk failure of one of the members of my RAID-1 boot disk. Fortunately for me it turned out to be the non-boot disk (ie I had hda and hdc mirrored, and hdc was the one that died -- fortunately my recovery process worked), however it does raise a question:

If the disk that failed turned out to be the boot disk, how would I boot off of the survivor? ie if hda had died, how do I boot of hdc once I'd replaced the dead one?

I suspect the answer is "get a rescue CD", but if there are better answers I'd like to hear them.

eco 03-26-2007 11:03 AM

I guess you are talking about software RAID...
I use mdadm. What I had to do was install the bootloader in the MBR of both disks with grub.
livecd linux # grub --no-floppy --device-map=/boot/grub/

grub> device (hd0) /dev/hda
grub> root (hd0,0)
grub> setup (hd0)

grub> device (hd0) /dev/hdc
grub> root (hd0,0)
grub> setup (hd0)

grub> quit
This way, you can boot of any disk and the box will boot.

If you need to add a new disk to the degraded RAID, view the man pages of mdadm, it's all there... I seem to remember something along the lines of:

mdadm /dev/mdx -a /dev/hdax
where mdx is the RAID that you want to fix and hdax is the disk (partition) you want to add to the degraded RAID.

A watch cat /proc/mdstat will help


mackdav 03-27-2007 10:29 AM

Not quite what I'd asked.

My scenario: I have two disks, hda and hdb. hda dies, so I replace it with a blank disk. Now when I boot, my computer says: hey, there's no OS on hda... how do I get past that?

JimBass 03-27-2007 10:38 AM

Actually, what he wrote is very much what you need to do. You'll need to install grub to /dev/hdb in your case, or you could swap the location of the drive, from the secondary to the primary position. You should also rebuilt as detailed in this article, once you get the system back up with one good and one empty disk -


mackdav 04-03-2007 04:20 PM

Ahh, I see. I did not read anywhere in the literature that if hda dies, I can insert hdb into hda's place, then add a new hdb, and the system would boot.

I only have experience with systems like Sun's ODS, which gets annoyed if you fail one disk then change the IDs of the survivors.

eco 04-04-2007 02:04 AM

It's probably not in the doc 'cause it's not the proper way but it certainly works. I did it until I found you could boot of any disk in the RAID.

Remember you can test by software failing the disk. This will avoid you having to disconnect a disk, boot, reconnect, ...

Best of luck.

All times are GMT -5. The time now is 08:04 PM.