Bug 154768 - mkinitrd creates broken ramdisks if /etc/fstab contains 'rw'
mkinitrd creates broken ramdisks if /etc/fstab contains 'rw'
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mkinitrd (Show other bugs)
4.0
All Linux
medium Severity low
: ---
: ---
Assigned To: Brian Lane
Kevin Baker
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-13 21:39 EDT by Wojciech Palacz
Modified: 2014-12-01 18:08 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-07-27 13:57:14 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)

  None (edit)
Description Wojciech Palacz 2005-04-13 21:39:21 EDT
Description of problem:
system won't boot with an initrd image, if it was created when /etc/fstab
contained 'rw' in the root filesystem options

Version-Release number of selected component (if applicable):
mkinitrd-4.1.18-2

How reproducible:
always

Steps to Reproduce:
1. edit /etc/fstab, replace 'defaults' with 'rw'
2. do something which invokes mkinitrd (e.g. install updated kernel)
3. reboot
  
Actual results:
initrd mounts / read-write, then 'fsck /' fails, and rc.sysinit drops
you to the emergency shell

Expected results:
should boot without problems

Additional info:
problem lies with one command in the generated ramdisk
    mount -o rw --ro -t ext3 /dev/root /sysroot
which mounts in rw mode, instead of ro mode.

Can be difficult to figure out if several months pass between 1. and 2.

You can either fix nash, so that '--ro' will have higher priority
than '-o rw', or enhance mkinird to do s/rw/defaults/.
Comment 1 Peter Jones 2005-04-20 14:47:37 EDT
Why is it set to "rw" in /etc/fstab?  I think this shouldn't be a supported
thing to do, but if you've got a good reason, I'd like to hear it so I can
reconsider.
Comment 2 Wojciech Palacz 2005-04-21 11:20:15 EDT
> Why is it set to "rw" in /etc/fstab?

No particular reason. I was editing /etc/fstab by hand, and "rw" is
easier to type than "defaults".

> I think this shouldn't be a supported thing to do...

mount(8) says "defaults -- Use default options: rw, suid, dev, exec,
auto, nouser, and async".
So, IMHO, system should behave exactly the same no matter if /etc/fstab
contains "defaults", "rw", "rw,suid,dev", "suid,async", or any other
subset of default options.

Consider also the reverse of your question - is there a good reason why
user should not be allowed to put "rw" into /etc/fstab ?

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