Bug 768778 - dracut-014-9.git20111215.fc17 generated initramfs prevents booting
Summary: dracut-014-9.git20111215.fc17 generated initramfs prevents booting
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 16
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: dracut-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-18 20:07 UTC by Michal Jaegermann
Modified: 2012-01-18 20:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-18 20:07:43 UTC
Type: ---


Attachments (Terms of Use)
Don't pass mount options to fsck (737 bytes, patch)
2012-01-11 02:36 UTC, Duane Griffin
no flags Details | Diff

Description Michal Jaegermann 2011-12-18 20:07:24 UTC
Description of problem:

More precisely - with initramfs generated by a dracut from the current rawhide it is impossible to boot without a manual intervention.  What happens is that dracut prints at some moment:

dracut: issuing e2fsck -a defaults /dev/sdc2

Not that surprisingly a response is:

Usage: e2fsck [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
                [-I inode_buffer_blocks] [-P process_inode_size]
                [-l|-L bad_blocks_file] [-C fd] [-j external_journal]
                [-E extended-options] device

Emergency help:
.....

(that should be 'e2fsck -p ...' - BTW) and dracut informs me that
"e2fsck returned with 16" and drops me in an emergency shell complaining about missing job control for a good measure.

There is nothing wrong with a file system on /dev/sdc2; simply e2fsck dislikes such invocation. Is that "defaults" grabbed from /etc/fstab by any chance? I failed to figure out how dracut constructs such bogosity.

Version-Release number of selected component (if applicable):
dracut-014-9.git20111215.fc17

How reproducible:
always

Additional info:
Reverting to dracut-013-100.git20111021.fc17 and rebuilding initramfs with its help creates something which can be used.

Comment 1 Harald Hoyer 2012-01-05 09:42:51 UTC
what is your /etc/fstab?

Comment 2 Michal Jaegermann 2012-01-05 17:45:15 UTC
(In reply to comment #1)
> what is your /etc/fstab?

e2fsck was choking in a described manner on a /usr file system so if you wonder if I have in /etc/fstab a line with a pattern

  ....  /usr   ext?    defaults  ....

then yes, such line is there (and it will stay).

Comment 3 Duane Griffin 2012-01-11 02:35:55 UTC
I'm seeing the same problem here. The bug is in the mount-usr.sh script, which is passing the mount options from fstab to fsck_single to use as fsck options. I'll attach a patch which fixes it for me.

Comment 4 Duane Griffin 2012-01-11 02:36:43 UTC
Created attachment 551988 [details]
Don't pass mount options to fsck

Comment 5 Michal Jaegermann 2012-01-11 06:39:25 UTC
(In reply to comment #4)
> Don't pass mount options to fsck

Hm, if fsck_single is just running a file system check and nothing else (I do not have that code handy in this moment) then does it really needs to know "$_fs"?
One would think that "$_dev", and a check that it is not mounted yet, should be enough.  Or there is an assumption that fsck used here is somewhat "dumb"?

How useful are "$_opts" in any case?  Options passed with '-o' to mount program and options field in fstab are related but not identical.

Comment 6 Duane Griffin 2012-01-11 10:20:52 UTC
(In reply to comment #5)
> 
> Hm, if fsck_single is just running a file system check and nothing else (I do
> not have that code handy in this moment) then does it really needs to know
> "$_fs"?
> One would think that "$_dev", and a check that it is not mounted yet, should be
> enough.  Or there is an assumption that fsck used here is somewhat "dumb"?

The filesystem type is required by the fsck_single function as it stands. The modules.d/99fs-lib/fs-lib.sh script runs different commands depending on the filesystem type, and since the caller has already parsed fstab it makes sense to pass it in.

XFS, for e.g., runs a bunch of commands, including mounting & unmounting the filesystem. I'm not familiar with the fsck process for all the supported fileystems, but I assume just calling /sbin/fsck isn't sufficient.

> How useful are "$_opts" in any case?  Options passed with '-o' to mount program
> and options field in fstab are related but not identical.

In the case of mounting /usr it appears they are just logged (that is what echoing to stdout does in dracut scripts, right?), with ",ro" appended unconditionally. Which seems wrong, since it isn't added to the actual mount command, AFAICS.

Comment 7 Michal Jaegermann 2012-01-18 20:07:43 UTC
dracut-014-38.git20120117.fc17 generated initrams does not try to add bogus options to fsck (but see bug 782897).


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