checkroot.sh: does not properly handle fsck exit states

Bug #28053 reported by Debian Bug Importer
4
Affects Status Importance Assigned to Milestone
sysvinit (Debian)
Fix Released
Unknown
sysvinit (Ubuntu)
Invalid
High
Scott James Remnant (Canonical)

Bug Description

Automatically imported from Debian bug report #346148 http://bugs.debian.org/346148

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Fri, 06 Jan 2006 00:07:20 +0100
From: Wouter Verhelst <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: checkroot.sh: does not properly handle fsck exit states

Package: initscripts
Version: 2.86.ds1-6
Severity: critical
Justification: may cause data loss

Hi,

I just noticed that my laptop, at bootup, started an fsck for the root
filesystem, claiming that it was a filesystem with errors. When it was
about 20% done, it exited, and told me to rerun it manually. I expected
a prompt for my root password and to be put in single-user mode, but
this did not happen; instead, my system did a normal boot.

This should _never_ happen! If the fsck fails, all sorts of bad things
might have happened with the file system; continueing the boot at that
point is a very good way to lose all your data.

I was lucky to have spotted it...

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14.4
Locale: LANG=nl_BE.UTF-8@euro, LC_CTYPE=nl_BE.UTF-8@euro (charmap=UTF-8)

Versions of packages initscripts depends on:
ii coreutils 5.93-5 The GNU core utilities
ii dpkg 1.13.11 package maintenance system for Deb
ii e2fsprogs 1.38+1.39-WIP-2005.12.10-1 ext2 file system utilities and lib
ii libc6 2.3.5-11 GNU C Library: Shared libraries an
ii lsb-base 3.0-13 Linux Standard Base 3.0 init scrip
ii util-linux 2.12r-2 Miscellaneous system utilities

initscripts recommends no packages.

-- no debconf information

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 5 Jan 2006 22:30:35 -0200
From: Henrique de Moraes Holschuh <email address hidden>
To: Wouter Verhelst <email address hidden>, <email address hidden>
Subject: Re: [Pkg-sysvinit-devel] Bug#346148: checkroot.sh: does not properly handle fsck exit states

On Fri, 06 Jan 2006, Wouter Verhelst wrote:
> I just noticed that my laptop, at bootup, started an fsck for the root
> filesystem, claiming that it was a filesystem with errors. When it was
> about 20% done, it exited, and told me to rerun it manually. I expected
> a prompt for my root password and to be put in single-user mode, but
> this did not happen; instead, my system did a normal boot.

This means fsck returned error codes 2 or 3. If fsck needs to be re-run
manually, it should have something else (bit 1 should not be set, bit 2
should be set, and I am not sure about bit 3. Other bits should be unset).

What is your root filesystem?

--
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

I'm claiming sysvinit currently

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Fri, 6 Jan 2006 09:17:44 +0100
From: Wouter Verhelst <email address hidden>
To: Henrique de Moraes Holschuh <email address hidden>
Cc: <email address hidden>
Subject: Re: (fwd) Bug#346148: [Pkg-sysvinit-devel] Bug#346148: checkroot.sh: does not properly
 handle fsck exit states

On Thu, Jan 05, 2006 at 10:37:14PM -0200, Henrique de Moraes Holschuh wrote:
> On Fri, 06 Jan 2006, Wouter Verhelst wrote:
> > I just noticed that my laptop, at bootup, started an fsck for the root
> > filesystem, claiming that it was a filesystem with errors. When it was
> > about 20% done, it exited, and told me to rerun it manually. I expected
> > a prompt for my root password and to be put in single-user mode, but
> > this did not happen; instead, my system did a normal boot.
>
> This means fsck returned error codes 2 or 3. If fsck needs to be re-run
> manually, it should have something else (bit 1 should not be set, bit 2
> should be set, and I am not sure about bit 3. Other bits should be unset).
>
> What is your root filesystem?

ext3

--
.../ -/ ---/ .--./ / .--/ .-/ .../ -/ ../ -./ --./ / -.--/ ---/ ..-/ .-./ / -/
../ --/ ./ / .--/ ../ -/ ..../ / -../ ./ -.-./ ---/ -../ ../ -./ --./ / --/
-.--/ / .../ ../ --./ -./ .-/ -/ ..-/ .-./ ./ .-.-.-/ / --/ ---/ .-./ .../ ./ /
../ .../ / ---/ ..-/ -/ -../ .-/ -/ ./ -../ / -/ ./ -.-./ ..../ -./ ---/ .-../
---/ --./ -.--/ / .-/ -./ -.--/ .--/ .-/ -.--/ .-.-.-/ / ...-.-/

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Marking as duplicate based on debbugs merge (342160,346148)

This bug has been marked as a duplicate of bug 28067.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Fri, 06 Jan 2006 12:01:40 +0100
From: Thomas Hood <email address hidden>
To: <email address hidden>
Cc: <email address hidden>
Subject: Re: [Pkg-sysvinit-devel] Bug#346148: checkroot.sh: does not properly handle fsck exit states

tags 346148 fixed-in-experimental patch pending
severity 342160 critical
merge 346148 342160
found 346148 2.86.ds1-4
stop

Wouter Verhelst wrote:
> I just noticed that my laptop, at bootup, started an fsck for the root
> filesystem, claiming that it was a filesystem with errors. When it was
> about 20% done, it exited, and told me to rerun it manually. I expected
> a prompt for my root password and to be put in single-user mode, but
> this did not happen; instead, my system did a normal boot.
>
> This should _never_ happen! If the fsck fails, all sorts of bad things
> might have happened with the file system; continueing the boot at that
> point is a very good way to lose all your data.

Thanks for reporting the bug.

checkroot.sh in at 2.86.ds1-[46] contains a bug such that the return status
of fsck is ignored. This bug has been fixed in more recent releases (to
experimental).

Additional info:

Reading checkroot.sh I see that it only continues with booting if the fsck
return status is 0 or 1. If the status is 2 or 3 then the system is rebooted
after five seconds. If the status is greater than 3 then a shell is started.

The comment in checkroot.sh says "A return code of 1 indicates that file system
errors were corrected but that the boot may proceed."

The fsck(8) and fsck.ext3(8) man pages say that 1 means "File system errors
corrected".
--
Thomas Hood

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.