Bug 154768 - mkinitrd creates broken ramdisks if /etc/fstab contains 'rw'
Summary: mkinitrd creates broken ramdisks if /etc/fstab contains 'rw'
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mkinitrd
Version: 4.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Brian Lane
QA Contact: Kevin Baker
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-04-14 01:39 UTC by Wojciech Palacz
Modified: 2014-12-01 23:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-27 17:57:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Wojciech Palacz 2005-04-14 01:39:21 UTC
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 18:47:37 UTC
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 15:20:15 UTC
> 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.