Checkfs drops to shell on return value 1 - should continue. Does not reboot if fsck returnvalue has bit 2 set (ie retval=2,3,6,7,10,11,etc). I suspect that reboot is only required if we're on the root fs, but know if that's guaranteed...should handle it anyway. I'd already fixed this on my machine (i think), but it seems daft not to share... The patch is a bit long, as it contains lots of info messages when fsck errors occur. It also contains some debugging cruft near the beginning, which allows to test its behaviour without rebooting. DO NOT ENABLE THE DEBUGGING STUFF IF YOU HAVE RAID/MD/LVM. I haven't tested it with any of those, don't know what it would do. Hope this helps someone! Charlie Reproducible: Always Steps to Reproduce: 1. Crash computer 2. if fsck retval is 1, drops to shell. 3. ( haven't been able to force a return value with bit2 set)
Created attachment 19358 [details, diff] Proposed patch for /etc/init.d/checkfs. Hmmm...the patch is half as long as the script...perhaps I got a bit carried away. I've tested this to the best of my ability, but please audit it well - I'd hate to have ruined someone's filesystems.
I do not see why we should handle anything not handled now. If return is 2 or 3, it will not drop you to console, as it did fix whatever. Anything else we do not handle, or need investigation. As for the reboot one - its not your root (/) partition, so not mounted, so no reboot needed. The only thing needing change, is this test: -- elif [ "${retval}" -gt 1 -a "${retval}" -lt 4 ] -- that should read: -- elif [ "${retval}" -ge 1 -a "${retval}" -le 3 ] --
Fair enough!! That was the problem that originally got me. ( though reiserfs looks like it can return 2 - if I read right - when it needs a rebuild-tree, whatever that means. If that happens, it means that current checkfs will mount a filesystem with errors, checkroot will reboot repeatedly. Perhaps I got this wrong, or else it must be extremely rare...perhaps only with hardware failure? ) I would like to have an echo of any non-zero fsck return value - it's useful information, and I'd never have had that last coronary if I'd seen it!!!
Fixed in CVS.