Bug 537882 - deal with mount options under dracut
Summary: deal with mount options under dracut
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-16 17:02 UTC by Bill McGonigle
Modified: 2010-01-28 00:52 UTC (History)
1 user (show)

Fixed In Version: 004-4.fc12
Clone Of:
Environment:
Last Closed: 2010-01-28 00:52:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dmesg from f12 (32.90 KB, text/plain)
2009-11-16 17:02 UTC, Bill McGonigle
no flags Details

Description Bill McGonigle 2009-11-16 17:02:48 UTC
Created attachment 369745 [details]
dmesg from f12

after upgrading an f11 system to f12 (i386), I'm getting the root filesystem mounted read-only.

Userland seems fine.  Boot results:

f12 kernel with initramfs - device mapper complaints, r/o filesystem
f11 kernel with initrd - system works fine
f11 kernel with initramfs (built by plymouth while booted into f11) - no device mapper complaints, but r/o root filesystem.

attaching dmesg from f12/initramfs boot

Comment 1 Bill McGonigle 2009-11-16 17:04:18 UTC
Oh, I should mention, I tried the workaround listed for bug 530896 (forcing rhgb boot) as it looked similar, and it didn't help

Comment 2 Bill McGonigle 2009-11-16 17:11:13 UTC
I'm sorry, reading the dmesg here somehow I saw the line I missed previously which is likely the cause:

EXT3-fs (device dm-0): Cannot change data mode on remount. The filesystem is mounted in data=ordered mode and you try to remount it in data=journal mode.

I'll edit my fstab to get around this and rebuild the initramfs.  I think we can deal with this more elegantly under dracut, so modifying the subject to reflect that.

Comment 3 Harald Hoyer 2009-11-16 18:15:37 UTC
dracut does not mount the filesystem rw unless you tell it to do so!
rc.sysinit remounts the filesystem rw... but that's after dracut calls the real /sbin/init on the real root

Comment 4 Harald Hoyer 2009-11-16 18:17:14 UTC
hfs: write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.
hfs: filesystem is marked journaled, leaving read-only.

Comment 5 Harald Hoyer 2009-11-16 18:30:38 UTC
also, if you need special mount options for the initial root mounting, use the following kernel command line options (as seen on the dracut manpage):

rootfstype=<filesystem type>
   "auto" if not specified, e.g. rootfstype=ext3 

rootflags=<mount options>
  specify additional mount options for the root filesystem

Comment 6 Bill McGonigle 2009-11-16 20:11:35 UTC
sorry for the ignorance, just reading through an initramfs for the first time today, so take the following in context:

If I understand it, we could modify 
  mount/99mount-root.sh 
such that it:

1) mounts as-is
2) does a quick /etc/fstab parse for mount options on /
3) if not 'defaults', unmount and remount with proper options
4) pass along proper options for final rw mounting

I didn't manage to figure out which component owns the scripts on the initramfs - please switch from 'dracut' as appropriate.

It seems with dynamic device discovery, hard-coding kernel flags in grub goes in the non-dynamic direction, besides making upgrades tricky.

  rootflags=data=journal,relatime 

added to my grub.conf's does solve the immediate upgrade problem for the systems I look after, thank you.

Comment 7 Bill McGonigle 2009-11-16 20:14:08 UTC
Oh, I'll add to the YumUpgradeFAQ and ask on the list if it should be on one of the notes pages.

Comment 8 Harald Hoyer 2009-11-17 09:27:46 UTC
(In reply to comment #6)
> sorry for the ignorance, just reading through an initramfs for the first time
> today, so take the following in context:
> 
> If I understand it, we could modify 
>   mount/99mount-root.sh 
> such that it:
> 
> 1) mounts as-is
> 2) does a quick /etc/fstab parse for mount options on /

hmm, there is no /etc/fstab in the initramfs

> 3) if not 'defaults', unmount and remount with proper options
> 4) pass along proper options for final rw mounting
> 
> I didn't manage to figure out which component owns the scripts on the initramfs
> - please switch from 'dracut' as appropriate.

yes, it is dracut.

> 
> It seems with dynamic device discovery, hard-coding kernel flags in grub goes
> in the non-dynamic direction, besides making upgrades tricky.
> 
>   rootflags=data=journal,relatime 
> 
> added to my grub.conf's does solve the immediate upgrade problem for the
> systems I look after, thank you.  

which is the right thing to do.

Comment 9 Harald Hoyer 2009-11-17 09:29:42 UTC
(In reply to comment #6)
> 3) if not 'defaults', unmount and remount with proper options

This should be done in rc.sysinit, shouldn't it?

Mounting the filesystem read-only in dracut, should not need any special options.
in rc.sysinit, when we are in real root, it can easily be remounted writeable with the correct options.

Comment 10 Bill McGonigle 2009-11-17 21:54:12 UTC
> hmm, there is no /etc/fstab in the initramfs

right, I mean read it from the root device, since that's 'real'.

> which is the right thing to do.  

right by the man page, certainly, but not from a dynamic configuration perspective.  I'm under the impression that the impetus to move to dracut was to make the boot process able to be more dynamic and do away with the difficulties of initrd.  Moving the configuration to a flat file is a marginal improvement, but why not just get rid of the duplicate configuration step altogether?  It's certain to get out of sync for users and sysadmins innumerable times if people have to remember to always update two files.

> Mounting the filesystem read-only in dracut, should not need any special
> options. in rc.sysinit, when we are in real root, it can easily be remounted
> writeable with the correct options.  

some filesystems (like ext3) cannot switch from ro to rw and change other mount options at the same time.

so, if you do:

  mount -t ext3 /dev/whatever /mnt/tmp -oro

with implicit defaults (e.g. data=ordered, atime) and then try:

  mount -t ext3 /dev/whatever /mnt/tmp -orw,remount,data=journal,relatime

that will fail.  You can change from ro to rw with the same mount options (there may be some options that don't care, but some do).  Unmounting and re-mounting is the only way to change those options, and AIUI that's not an option for rc.sysinit (please correct me if  I'm wrong here).

So, the only hope to successfully mount / rw with fstab options is to mount it with the correct options in the ro stage, which is what initrd always did, and I assume what the hard-coded kernel-flag options are doing.

Comment 11 Fedora Update System 2009-11-27 15:12:35 UTC
dracut-003-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/dracut-003-1.fc12

Comment 12 Fedora Update System 2009-12-01 04:39:58 UTC
dracut-003-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12432

Comment 13 Fedora Update System 2010-01-26 10:47:55 UTC
dracut-004-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/dracut-004-4.fc12

Comment 14 Fedora Update System 2010-01-27 01:05:27 UTC
dracut-004-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-1088

Comment 15 Bill McGonigle 2010-01-27 23:41:38 UTC
Beautiful, 004-4 works perfectly on at least one of my f12 systems.  I've cut the rootflags out of my grub and the system boots properly.

FYI, 003-1 didn't (I forgot to note that here previously).

Comment 16 Fedora Update System 2010-01-28 00:50:44 UTC
dracut-004-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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