openrc-discuss

Re: Re: Bug in init.d/fsck causes severe filesystem corruption

Roy Marples

Mon Mar 16 21:59:35 2009

Doug Goldstein wrote:
On Mon, Mar 16, 2009 at 3:58 PM, Roy Marples <roy@xxxxxxxxxxxx> wrote:
Elvis Pranskevichus wrote:
One of the servers I manage died today as a consequence of the openrc
allowing the system to boot with filesystem errors uncorrected.

Here's a relevant part from /etc/init.d/fsck:

       4)      if [ "${RC_UNAME}" = "Linux" ]; then
                       ewend 1 "Fileystem errors left uncorrected"
                       return 0
               else
                       ewend 1 "Filesystems repaired, but reboot needed"
                       _reboot
               fi;;

I'm wondering why "Filesystem errors left uncorrected" is somehow ok?
It used to reboot the system. From memory either cardoe or robbat2 submitted
the change because it got into an infinite loop. I suppose we could try and
abort the boot on the 4 code.

The change I submitted was wrt to incorrect handling of the return
type that resulted in an infinite loop. The filesystem would be
checked, errors would be detected and it would tell me that there were
errors on the filesystem and immediately reboot. It never allowed be
to enter single user mode and correct the issue. In fact, I couldn't
even boot into single user mode because fsck was occurring very early.
I had to boot with my init=/bin/bb and setup my environment myself and
fsck the disk.

http://roy.marples.name/projects/openrc/changeset/1509/trunk/init.d/fsck.in

That should fix the issue.

Thanks

Roy


References:
Bug in init.d/fsck causes severe filesystem corruptionElvis Pranskevichus
Re: Bug in init.d/fsck causes severe filesystem corruptionRoy Marples
Re: Bug in init.d/fsck causes severe filesystem corruptionDoug Goldstein
Archive administrator: postmaster@marples.name