Bug 768778

Summary: dracut-014-9.git20111215.fc17 generated initramfs prevents booting
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: dracutAssignee: dracut-maint
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: dracut-maint, duaneg, harald, jonathan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-18 20:07:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Don't pass mount options to fsck none

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).