Bug 217176

Summary: error installing grub on raid devices
Product: Red Hat Enterprise Linux 4 Reporter: Paolo Penzo <paolo.penzo>
Component: anacondaAssignee: Hans de Goede <hdegoede>
Status: CLOSED ERRATA QA Contact: Alexander Todorov <atodorov>
Severity: high Docs Contact:
Priority: medium    
Version: 4.4CC: atodorov, jgranado, jjneely, sprelutsky, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 20:16:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Install time logs
none
sosreport of affected system none

Description Paolo Penzo 2006-11-24 17:35:08 UTC
I'm trying to install grub on a software raid1 device with the following ks setup

bootloader --location=mbr

clearpart --all --initlabel
part raid.01 --size=1 --grow --ondisk=sda
part raid.02 --size=1 --grow --ondisk=sdb
part swap --size=1024 --grow --maxsize=2048 --ondisk=sdb
part swap --size=1024 --grow --maxsize=2048 --ondisk=sda
raid / --fstype ext3 --level=raid1 raid.01 raid.02

The installations procedes fine but the systems won't reboot after the install
process has completed. So I have to restart with the rescue image and install
grub manually.

In the anaconda.log I got
MBR not suitable as boot device; installing to partition

and in the anaconda-ks.cfg
bootloader --location=partition --append="rhgb quiet"

It's clear that the installer was not able to write to the MBR...

Comment 1 Sarah Prelutsky 2007-05-18 00:29:01 UTC
I was able to reproduce this bug on RHEL4u3 and in part on RHEL4u4

On rhel4u3:
Installing from kickstart and specifying "bootloader --location=mbr" results in
the bootloader being installed to the partition and are unable to boot the os
after a reboot. You have to boot the rescue environment and re-setup grub.

On rhel4u4:
Installing from kickstart and specifying "bootloader --location=mbr" results in
the bootloader being installed to the partition. Everything is fine on reboot.
You can fail a drive with mdadm and boot from the 2nd drive (software raid1 2
drives) as expected. You can pull even pull out the 1st drive in Bay0 and reboot
and the os will boot from the 2nd drive just fine.

I can reproduce this reliably on both releases.

I have yet to try update 5.

Comment 2 Jack Neely 2007-06-19 18:11:23 UTC
Being that this rears its ugly head frequently its high time I at least dropped
in the kickstart magic needed to correct non-booting RAID setups.  I'm using a
%post script that installs grub to both sda and sdb so that the machine will
still boot if sda fails.  It attempts to correct the grub device map and
installs grub into the MBR rather than the partitioning.  This wipes whatever
vendor black magic is in the MBR and allows the thing to boot.

%post

if ! grep "(hd1)" /boot/grub/device.map > /dev/null ; then
    echo "(hd1)     /dev/sdb" >> /boot/grub/device.map
fi

/sbin/grub --batch << EOT
device (hd0) /dev/sda
root (hd0,0)
setup (hd0)

device (hd1) /dev/sdb
root (hd1,0)
setup (hd1)
quit
EOT


Comment 3 Steve 2008-07-09 16:44:08 UTC
Created attachment 311385 [details]
Install time logs

Comment 5 Steve 2008-07-09 17:11:02 UTC
Created attachment 311386 [details]
sosreport of affected system

Comment 6 RHEL Program Management 2008-09-25 07:23:34 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 8 Hans de Goede 2008-12-15 16:07:14 UTC
A patch fixing this has been committed to the RHEL-4 anaconda branch:
http://git.fedorahosted.org/git/?p=anaconda.git;a=commitdiff;h=1263e881d7029c85bb0cca42abd5851827751d17

This fix will be included in anaconda-10.1.1.92 .

Comment 10 Alexander Todorov 2009-02-13 14:51:53 UTC
Tested with reproducer from comment #0 anaconda-10.1.1.96-1: 

anaconda-ks.cfg has:
bootloader --location=mbr

the error message in anaconda.log from comment #0 is not present. Moving to VERIFIED.

Comment 12 errata-xmlrpc 2009-05-18 20:16:22 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0978.html