openrc-discuss

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

Doug Goldstein

Mon Mar 16 21:18:46 2009

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.
>
>> This is what actually happened:
>>
>> * Checking local filesystems ...
>> root contains a file system with errors, check forced.
>> root: Deleted inode 84 has zero dtime.  FIXED.
>> root: Inodes that were part of a corrupted orphan linked list found.
>>
>> root: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
>>        (i.e., without -a or -p options)
>> * Fileystem errors left uncorrected
>>  [ !! ]
>> * Remounting root filesystem read/write...
>>  [ ok ]
>>
>> The result is a completely messed up fs.
>>
>> I'm using openrc-0.4.3 and baselayout-2.0.0 on gentoo.
>
> Yeah, aborting the boot may cure that
>
> Thanks
>
> Roy
>

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.

-- 
Doug Goldstein

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