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
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
|
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
Wednesday, 13 April 2011, 09:18 GMT
Reason for closing: No response
* 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`
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.