Bug 171871 - mkinitrd can produce broken linuxrc file
mkinitrd can produce broken linuxrc file
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: mkinitrd (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brian Lane
Kevin Baker
:
Depends On:
Blocks: 190430
  Show dependency treegraph
 
Reported: 2005-10-27 06:39 EDT by Bastien Nocera
Modified: 2014-12-01 18:08 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:22:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
example-fstab (2.22 KB, text/plain)
2005-10-27 06:39 EDT, Bastien Nocera
no flags Details

  None (edit)
Description Bastien Nocera 2005-10-27 06:39:55 EDT
Present in RHEL3 (mkinitrd-3.5.13-6.1) and RHEL4 (mkinitrd-4.2.1.6-1).

1. Run mkinitrd on the attached fstab
2. the linuxrc will contain a 3 line root mount command:
 mount -o defaults
 defaults --ro -t ext3
 ext3 /dev/root /sysroot
instead of:
 mount -o default --ro -t ext3 /dev/root /sysroot

The fix is to replace the following awk commands:
 rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
 rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
with:
 rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; exit }}' $fstab)
 rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; exit }}' $fstab)

(Notice the exit after the print statement)

"Patch" by Martin Poole <mpoole@redhat.com>
Comment 1 Bastien Nocera 2005-10-27 06:39:56 EDT
Created attachment 120458 [details]
example-fstab
Comment 4 Kenneth MacDonald 2007-07-16 07:06:45 EDT
This happens whenever there are two lines in /etc/fstab with the "/" mount
point.  I've just been stung by this bug in FC6 too.  

Martin's suggested fix takes the first entry in /etc/fstab.  Alternatively,
using "tail -n 1" after the awk will get the last entry from /etc/fstab.

This leaves the system unbootable when it happens.  
Comment 6 Jiri Pallich 2012-06-20 09:22:04 EDT
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

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