RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 841452 - Grub picks bad root device when using mdadm raid1
Summary: Grub picks bad root device when using mdadm raid1
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: grub
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Václav Pavlín
QA Contact: Release Test Team
URL:
Whiteboard:
: 1260540 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-19 04:02 UTC by Phil Anderson
Modified: 2015-10-23 13:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-03 08:53:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Phil Anderson 2012-07-19 04:02:12 UTC
When installing grub on a raid1 boot device, grub-install doesn't make a sensible choice about which device to use as the root device.  This can lead to booting being unnecessarily dependent on both drives in a mirrored configuration.

In my example, I have /dev/md0 made up of a raid1 array of /dev/sda1 & /dev/sdb1 which is mounted as /boot.

When I run grub-install /dev/md0 or /dev/sda, it uses (hd1,0) as the root drive, due to mdadm arbitrarily returning /dev/sdb1 as the first device in the array.  This due to the following code in grub-install:
# There's not a real root device, so just pick the first
if is_raid1_device $root_device ; then
    root_device=`find_real_devs $root_device | awk '{print $1}'`
fi

As grub (installed on the first disk) is looking for the second disk, I am unable to boot should the second disk fail.

grub-install could be smartened up to prefer a root_device on the same disk which we are installing grub on, or possibly the lower numbered disk (assuming that if disk 0 fails, disk 1 becomes disk 0).  This would make booting after single a disk failure much more likely to succeed for simple mirrored configurations.

Comment 2 Vladimir Serbinenko 2012-08-01 17:54:14 UTC
This issue can't be solved reliably without UUIDs. Adding UUIDs to GRUB Legacy is possible (see e.g. Ubuntu patchs) it feels like an overkill for this old code and creates other problems which need hints to be solved.

Comment 3 Václav Pavlín 2012-12-06 13:40:13 UTC
Hi, would this solve your issue, Phil:
http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/008898.html

As Vladimir writes it would be probably overkill to implement this to Grub Legacy. If How-To from link works for you, I will close this bug.

Comment 4 Phil Anderson 2012-12-07 01:01:13 UTC
Unfortunately I don't have time at the moment to test that, but it sounds like it would work.  I simply tweaked grub-installer and hard coded root_device.  Not a proper solution, but it was quick and easy.

Comment 6 Václav Pavlín 2013-04-02 12:00:19 UTC
Phil, any news about the How-To? Can I close this bz?

Comment 7 Phil Anderson 2013-04-02 23:07:36 UTC
Feel free to close it if you want.  I manually changed grub_installer to effectively do what the How-To does and it worked fine.  I

Comment 8 Samantha N. Bueno 2015-10-23 13:59:01 UTC
*** Bug 1260540 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.