Skip to contentSkip to conversation

RAID 1 and grub

DISCUSSION Richard Scobie 6 participants 12 messages Jan 30, 2008 – Feb 3, 2008 MD RAID

lore
Share & tools
lore
#0 lore raw

I have a machine with Fedora core 8 installed onto RAID1 on IDE drives - hda and hdc.

hda has failed and after spending some time with a rescue disk mounting hdc's /boot partition (hdc1) and changing the grub.conf device parameters, I have no success in booting off it.

I then set them back to the original (hd0,0) and moved hdc into hda's position.

Booting from there brings up the message: GRUB hard disk error

Can any grub guru offer any assisentence as to what may be missing here?

Regards,

Richard

#1 lore raw
Quoted 8 lines · Richard Scobie

hda has failed and after spending some time with a rescue disk mounting hdc's /boot partition (hdc1) and changing the grub.conf device parameters, I have no success in booting off it.

I then set them back to the original (hd0,0) and moved hdc into hda's position.

Booting from there brings up the message: GRUB hard disk error

Have you tried re-running grub-install after booting from a rescue disk?

-Dave

#2 lore raw
Quoted 3 lines · David Rees

Have you tried re-running grub-install after booting from a rescue disk?

-Dave

Hi David,

I have but although I can advance further it seems that the BIOS is doing some strange things as well, switching drive ordering around.

With a new hda installed and partitioned, ready to be rebuilt, the good drive, hdc installed, the grub.conf modified to address (hd2,0) - I have
an hdb installed also, and grub installed on hdc, booting with the
BIOS set to start on hdc hangs with the message "grub stage2" then drops to a grub prompt.

I then enter "kernel (hd0,0)/vmlinuz" and it finds the kernel. I would have expected this to be on (hd2,0).

Next, "boot root=/dev/md2", "boot root=/dev/hdc3" or "boot root=/dev/hda3" all result in the kernel booting then panicing with a "cannot open root device".

I suspect you are correct that the Fedora installer, having built and installed to RAID1, does not finish the job by installing grub on the second drive.

While it is not a problem with this particular box to do a reinstall, it does not inspire confidence for a number of others that I have.

This is the first time I have lost the primary member of a RAID1, having replaced secondary members a number of times without issue.

Regards,

Richard

#3 lore raw
In reply to David Rees

A followup for the archives:

I found this document very useful:

http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/008898.html

After modifying my grub.conf to refer to (hd0,0), reinstalling grub on hdc with:

grub> device (hd0) /dev/hdc

grub> root (hd0,0)

grub> (hd0)

and rebooting with the bios set to boot off hdc, everything burst back into life.

I shall now be checking all my Fedora/Centos RAID1 installs for grub installed on both drives.

Regards,

Richard

#4 lore raw
Quoted 6 lines · Richard Scobie

I found this document very useful:
http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/008898.html

After modifying my grub.conf to refer to (hd0,0), reinstalling grub on hdc with:

Quoted 6 lines

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

and rebooting with the bios set to boot off hdc, everything burst back into life.

FWIW, this step is clearly marked in the Software-RAID HOWTO under "Booting on RAID":
http://tldp.org/HOWTO/Software-RAID-HOWTO-7.html#ss7.3

If it appears that Fedora isn't doing this when installing on a Software RAID 1 boot device, I suggest you open a bug.

BTW, I suspect you are missing the command "setup" from your 3rd command above, it should be:

# grub
grub> device (hd0) /dev/hdc
grub> root (hd0,0)
grub> setup (hd0)
Quoted 2 lines

I shall now be checking all my Fedora/Centos RAID1 installs for grub installed on both drives.

Good idea. Whenever setting up a RAID1 device to boot from, I perform the above 3 steps. I also suggest using labels to identify partitions and testing the two failure modes and that you are able to boot with either drive disconnected.

-Dave

#5 lore raw
Quoted 3 lines · David Rees

FWIW, this step is clearly marked in the Software-RAID HOWTO under "Booting on RAID":
http://tldp.org/HOWTO/Software-RAID-HOWTO-7.html#ss7.3

The one place I didn't look...

Quoted 7 lines

BTW, I suspect you are missing the command "setup" from your 3rd command above, it should be:

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

That is correct.

Regards,

Richard

#7 lore raw
In reply to David Rees
Quoted 5 lines · David Rees

On Jan 30, 2008 6:33 PM, Richard Scobie <[email protected]> wrote:

FWIW, this step is clearly marked in the Software-RAID HOWTO under "Booting on RAID":
http://tldp.org/HOWTO/Software-RAID-HOWTO-7.html#ss7.3

A good an extesive reference, but somewhat outdated.

Quoted 7 lines

BTW, I suspect you are missing the command "setup" from your 3rd command above, it should be:

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

I do not grasp this. How and where is it said that two disks are involved? hda and hdc should both be involved.

Best regards
keld

#8 lore raw
Quoted 7 lines · Keld Jørn Simonsen
Quoted 4 lines
# grub
grub> device (hd0) /dev/hdc
grub> root (hd0,0)
grub> setup (hd0)

I do not grasp this. How and where is it said that two disks are involved? hda and hdc should both be involved.

There are not two disks involved in this instance.

This is used in the scenario where the primary disk in the RAID1 (/dev/hda), already has grub installed in the MBR and you wish to install it on the secondary drive (/dev/hdc).

This then allows for a failed primary drive to be removed and the machine to boot from the secondary - (may need BIOS to be set to boot from secondary drive).

As an aside, after last weeks discovery that the Fedora 8 install had not installed grub on the secondary drive, as part of a RAID 1 install, some cursory Googling and searching Redhat's Knowledge base leads me to believe that this may well be normal for all Redhat (RHEL/Fedora) RAID1 installs.

One has nothing to lose by installing grub on the second drive in this case and it may save some delay in recovery on losing the primary, although as has been pointed out, it is best practice to test missing drives as part of initial install testing.

Regards,

Richard
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw
In reply to Bill Davidsen
Quoted 13 lines · Bill Davidsen
Quoted 12 lines · Richard Scobie

A followup for the archives:

I found this document very useful:

http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/008898.html

After modifying my grub.conf to refer to (hd0,0), reinstalling grub on hdc with:

grub> device (hd0) /dev/hdc

grub> root (hd0,0)

Quoted 8 lines
Quoted 5 lines

grub> (hd0)

and rebooting with the bios set to boot off hdc, everything burst back into life.

I shall now be checking all my Fedora/Centos RAID1 installs for grub installed on both drives.

Have you actually tested this by removing the first hd and booting? Depending on the BIOS I believe that the fallback drive will be called hdc by the BIOS but will be hdd in the system. That was with RHEL3, but worth testing.

The line:

grub> device (hd0) /dev/hdc

simply means "treat /dev/hdc as the first _bios_ hard disk in the system". This way when grub writes to the MBR of hd0, it will be in fact writing to /dev/hdc. The reason the drive must be referenced as hd0 (and not hd2) is because grub enuerates drives according to the bios, and therefore the drive from which the bios is currently booting is _always_ hd0.

#9 lore raw
In reply to Richard Scobie
Quoted 10 lines · Richard Scobie

A followup for the archives:

I found this document very useful:

http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/008898.html

After modifying my grub.conf to refer to (hd0,0), reinstalling grub on hdc with:

grub> device (hd0) /dev/hdc

Quoted 7 lines

grub> root (hd0,0)

grub> (hd0)

and rebooting with the bios set to boot off hdc, everything burst back into life.

I shall now be checking all my Fedora/Centos RAID1 installs for grub installed on both drives.

Have you actually tested this by removing the first hd and booting? Depending on the BIOS I believe that the fallback drive will be called hdc by the BIOS but will be hdd in the system. That was with RHEL3, but worth testing.

Signature · 3 lines
Bill Davidsen <[email protected]>
 "Woe unto the statesman who makes war without a reason that will still
 be valid when the war is over..." Otto von Bismark 
#11 lore raw
Quoted 2 lines · Bill Davidsen

Have you actually tested this by removing the first hd and booting? Depending on the BIOS I believe that the fallback drive will be called hdc by the BIOS but will be hdd in the system. That was with RHEL3, but worth testing.

Hi Bill,

I did not try this particular combination. I shut the box down, removed the failed drive (hda) and installed it's replacement and proceeded from there.

Once I had discovered that hdc had no grub installed, after running:

grub> device (hd0) /dev/hdc

grub> root (hd0,0)

grub> setup (hd0)

I set the BIOS to boot from hdc and it all worked.

Regards,

Richard