Bug 209473 - mkinitrd --rootdev LABEL=foo doesn't work as expected
mkinitrd --rootdev LABEL=foo doesn't work as expected
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
David Lawrence
bzcl34nup
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-05 11:24 EDT by Mark McLoughlin
Modified: 2009-02-04 16:17 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-04 16:17:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The patch in question. (1.60 KB, patch)
2008-04-23 12:02 EDT, Peter Jones
no flags Details | Diff

  None (edit)
Description Mark McLoughlin 2006-10-05 11:24:12 EDT
If you have a rootdev-by-LABEL, it appears the mkinitrd resolves the label to a
specific device and hardcodes that device path in the initrd.

i.e. you get

  mkrootdev -t ext3 -o defaults,ro /dev/sdb

rather than

  mkrootdev -t ext3 -o defaults,ro LABEL=foo

See #209110 for the background.

It looks like the change occurred at revision 1.315 (2005/09/29):

-elif ! echo $rootdev | cut -c1-6 |grep -q "LABEL=" ; then
-    rawrootdev=$rootdev

+if echo $rootdev | cut -c1-6 | grep -q "LABEL=" ; then
+    majmin=$(stat -c "%t:%T" /dev/root)
+    if [ -n "$majmin" ]; then
+        dev=$(find /sys/block -name dev | while read device ; do \
+             echo "$majmin" | cmp -s $device && echo $device ; done)
+       if [ -n "$dev" ]; then
+            vecho "Found root device $dev for $rootdev"
+                rootdev=$dev
Comment 1 Martin Wyser 2006-11-03 05:32:53 EST
I have a similar problem with FC5 2.6.17.1.2145, where init in the initrd
contains the lines
resume LABEL=SWAP-hda2
mkrootdev -t ext3 -o defaults,ro hda1

After changing the partition numbers, this causes problems.  The hda1 is
especially troublesome, as the kernel is started with a root=LABEL=/ parameter,
which is just ignored in the initrd.
Comment 2 Bug Zapper 2008-04-03 14:26:41 EDT
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Comment 3 Rubin Simons 2008-04-23 10:25:13 EDT
I can confirm this bug still exists in RHEL 4 ES U5. I ran into it last week;
specify root as "LABEL=/" in /etc/fstab; watch mkinitrd skip lvm-specific steps
like copying {lvm.static, lvm.conf} and including more than only the dm-mod
module. It seems to me that bugs #212124, #214184, #246626, #294051, #327181 and
#426671 are related to this (not sure if they're strictly dupes). 
Comment 4 Peter Jones 2008-04-23 11:51:40 EDT
So, on the one hand this behavior is clearly wrong.  On the other, you should
still get "root=LABEL=/" in grub.conf , and that overrides mkrootdev's
behaviour, so it should still boot.  Mark, when you see this, is it actually not
booting?
Comment 5 Mark McLoughlin 2008-04-23 11:57:58 EDT
Oh, I think I was doing this in the context of stateless iSCSI root ...

So, I would have been booting via PXE and wanted the initrd to find the
appropriate device based on label, because some systems might have a SCSI disk
already (making the iSCSI disk e.g. /dev/sdb) and others might not

Pretty vague on the details now, though
Comment 6 Peter Jones 2008-04-23 12:01:10 EDT
OK, I /think/ the patch I just applied will solve this for you.
Comment 7 Peter Jones 2008-04-23 12:02:24 EDT
Created attachment 303521 [details]
The patch in question.
Comment 8 Peter Jones 2008-04-23 12:03:14 EDT
That patch will be in 6.0.52 .
Comment 9 Bug Zapper 2008-05-13 22:24:03 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 10 Hans de Goede 2009-02-04 16:17:53 EST
I've just build a new mkinitrd in rawhide (6.0.76) which streamlines the storage device handling somewhat. This should definitely fix --rootdev LABEL= , if not please reopen.

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