FS#16473 - [initscripts] File system (JFS) check failure in /etc/rc.sysinit

Attached to Project: Arch Linux
Opened by Ciprian Dorin Craciun (ciprian.craciun) - Monday, 05 October 2009, 17:43 GMT
Last edited by Tom Gundersen (tomegun) - Wednesday, 13 April 2011, 09:18 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Tom Gundersen (tomegun)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When reaching the "Checking Filesystems" step in /etc/rc.sysinit the following happens:
* FSCK_OUT=/dev/stdout
* FSCK_ERR=/dev/null
* /sbin/fsck ... >$FSCK_OUT 2>&FSCK_ERR

The context (and problem is as follows):
* in the default install there is no /dev/stdout on the installation disk; (fresh installation of ArchLinux 2009.08)
* udev probably makes this file as a symlink to /proc/self/fd/1, but unfortunately not at this step; or at least not in my case; (after booting the file is there;)
* the line with /sbin/fsck breaks with an error that it cannot find or create /dev/stdout;
* for JFS filesystems, jfs_fsck outputs to stdout any messages;

To fix this I made FSCK_OUT=/dev/console
This task depends upon

Closed by  Tom Gundersen (tomegun)
Wednesday, 13 April 2011, 09:18 GMT
Reason for closing:  No response
Comment by Aaron Griffin (phrakture) - Monday, 05 October 2009, 19:22 GMT
Seems like it should be safe to just set this to /dev/console no matter what, right?
Comment by Ciprian Dorin Craciun (ciprian.craciun) - Monday, 05 October 2009, 20:22 GMT
There are some issues with this one:
* first there is a serious bug here (see below at the end) (it just hit me now);
* I like the ArchLinux boot messages, but if you let fsck output something to either stdout or stderr, it will just display a lot of text (at least in the case of JFS);
* some fsck implementations use stderr, others use stdout (JFS uses stdout, Ext uses stderr (or?));

Thus I would suggest saving the output to a file and in case of error drop to the shell and show the log. (Wouldn't it be nice to have a progress bar? :) )

Also I think there is a subtle bug in the error handling code for fsck calling. For example if you run `echo a >/dev/this_does_not_exist` (as non-root), it's obvious that the command shall fail. But unfortunately it fails with the error code 1 (`echo $?` afterwards), which by mistake is just what fsck returns in case the file-system has been corrected.

So as a conclusion there is no way to tell wether there is a redirection error, or fsck just succeeded. (And in this case, hell breaks lose, because the system thinks it shall have a RW root, but instead it's just RO.)

But I think there could be a workaround by either:
* not using redirections;
* create a pipe and run `cat </.../path_to_pipe &` in background, then in foreground `fsck >/.../path_to_pipe >&2`
Comment by Tom Gundersen (tomegun) - Monday, 28 March 2011, 12:18 GMT
Can someone still reproduce this with a recent udev? With a standard Arch kernel? If you are self-compiling, are you using devtmpfs?

I'll close this bug if I don't hear back soon, as I'm pretty sure this has been solved in recent kernel/udev and that we are doing the right thing in rc.sysinit.

Loading...