Debian Bug report logs - #571241
checkroot.sh: should not try to fsck rootfs on ubifs

version graph

Package: initscripts; Maintainer for initscripts is Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>; Source for initscripts is src:sysvinit.

Reported by: Bart Trojanowski <bart@jukie.net>

Date: Wed, 24 Feb 2010 16:00:01 UTC

Severity: normal

Found in version sysvinit/2.87dsf-8

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#571241; Package initscripts. (Wed, 24 Feb 2010 16:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bart Trojanowski <bart@jukie.net>:
New Bug report received and forwarded. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 24 Feb 2010 16:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Bart Trojanowski <bart@jukie.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: checkroot.sh: should not try to fsck rootfs on ubifs
Date: Wed, 24 Feb 2010 10:52:54 -0500
Package: initscripts
Version: 2.87dsf-8
Severity: normal

checkroot.sh has this comment:

# Disabled AC power check until fsck can be told to only check the 
# file system if it is corrupt when running on battery. (bug #526398) 

and then it forces rootcheck to 'yes'.

I am running on a SheevaPlug.  I installed Debian on a UBIFS filesystem.
This filesystem does not require/have fsck.  That wouldn't be so bad if
checkroot.sh didn't forcefully create a /dev/root and try to fsck it.

At the serial console I see:

Checking file systems...fsck from util-linux-ng 2.16.2
uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock0, sector 0
Buffer I/O error on device mtdblock0, logical block 0
uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock0, sector 8

... this is a bit confusing because my ubifs rootfs is actually on
mtdblock2.  Here, mtdblock0 contains uboot data, which doesn't use
standard MTD checksumming that Linux understands, and that's why we are
getting I/O errors.

My naive fix was to apply the following patch:

--- 8< ---

--- a/init.d/checkroot.sh
+++ b/init.d/checkroot.sh
@@ -206,6 +206,7 @@ Will restart in 5 seconds."
 #              fi
 #      fi
        rootcheck=yes
+        ( [ "$roottype" = "ubifs" ] ) && rootcheck=no
 
        #
        # See if we want to check the root file system.

--- 8< ---

and this fixes the problems for me.

-Bart


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: armel (armv5tel)

Kernel: Linux 2.6.32.8 (PREEMPT)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initscripts depends on:
ii  coreutils                     7.4-2      The GNU core utilities
ii  debianutils                   3.2.2      Miscellaneous utilities specific t
ii  libc6                         2.10.2-2   GNU C Library: Shared libraries
ii  lsb-base                      3.2-23     Linux Standard Base 3.2 init scrip
ii  sysv-rc                       2.87dsf-8  System-V-like runlevel change mech
ii  sysvinit-utils                2.87dsf-8  System-V-like utilities

Versions of packages initscripts recommends:
ii  e2fsprogs                     1.41.9-1   ext2/ext3/ext4 file system utiliti
ii  psmisc                        22.10-1    utilities that use the proc file s

initscripts suggests no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#571241; Package initscripts. (Wed, 24 Feb 2010 17:48:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 24 Feb 2010 17:48:05 GMT) Full text and rfc822 format available.

Message #10 received at 571241@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Bart Trojanowski <bart@jukie.net>, 571241@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#571241: checkroot.sh: should not try to fsck rootfs on ubifs
Date: Wed, 24 Feb 2010 18:44:54 +0100
[Bart Trojanowski]
> I am running on a SheevaPlug.  I installed Debian on a UBIFS
> filesystem.  This filesystem does not require/have fsck.  That
> wouldn't be so bad if checkroot.sh didn't forcefully create a
> /dev/root and try to fsck it.

Does it not work to specify in /etc/fstab that the file system should
not be checked?  If no fsck is available for ubifs, which program is
used to do the fsck-ing?  I thought fsck used fsck.$type to do the
actual fsck operation.

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#571241; Package initscripts. (Wed, 24 Feb 2010 19:21:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bart Trojanowski <bart@jukie.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 24 Feb 2010 19:21:04 GMT) Full text and rfc822 format available.

Message #15 received at 571241@bugs.debian.org (full text, mbox):

From: Bart Trojanowski <bart@jukie.net>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: 571241@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#571241: checkroot.sh: should not try to fsck rootfs on ubifs
Date: Wed, 24 Feb 2010 14:12:17 -0500
* Petter Reinholdtsen <pere@hungry.com> [100224 13:02]:
> [Bart Trojanowski]
> > I am running on a SheevaPlug.  I installed Debian on a UBIFS
> > filesystem.  This filesystem does not require/have fsck.  That
> > wouldn't be so bad if checkroot.sh didn't forcefully create a
> > /dev/root and try to fsck it.
> 
> Does it not work to specify in /etc/fstab that the file system should
> not be checked?

This chunk (copied from checkroot.sh) completely ignores that:

                # See if we're on AC Power.  If not, we're not gonna run our
                # check.  If on_ac_power (in /usr/) is unavailable, behave as
                # before and check all file systems needing it.
        # Disabled AC power check until fsck can be told to only check the
        # file system if it is corrupt when running on battery. (bug #526398)
        #       if which on_ac_power >/dev/null 2>&1 && [ "$rootcheck" = yes ]
        #       then
        #               on_ac_power >/dev/null 2>&1
        #               if [ "$?" -eq 1 ]
        #               then
        #                       log_warning_msg "On battery power, so skipping file system check."
        #                       rootcheck=no
        #               fi
        #       fi
                rootcheck=yes

Note the last line just sets rootcheck to yes.

I just added this line:

        ( [ "$roottype" = "ubifs" ] ) && rootcheck=no

as the next line.

>  If no fsck is available for ubifs, which program is used to do the
>  fsck-ing?  I thought fsck used fsck.$type to do the actual fsck
>  operation.

You're right, I think I jumped the gun here.  The access is coming
later.  I'll have to figure out where, and open a better bug.

-Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#571241; Package initscripts. (Fri, 13 Aug 2010 23:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ron <ron@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Fri, 13 Aug 2010 23:33:03 GMT) Full text and rfc822 format available.

Message #20 received at 571241@bugs.debian.org (full text, mbox):

From: Ron <ron@debian.org>
To: 571241@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#571241: checkroot.sh: should not try to fsck rootfs on ubifs
Date: Sat, 14 Aug 2010 08:54:18 +0930
Hi,

Just some followup on this one ...

> Does it not work to specify in /etc/fstab that the file system should
> not be checked?  If no fsck is available for ubifs, which program is
> used to do the fsck-ing?  I thought fsck used fsck.$type to do the
> actual fsck operation.

This is what I'm seeing on squeeze from a couple of days ago:

 Checking root file system...fsck from util-linux-ng 2.17.2
 fsck: fsck.ubifs: not found
 fsck: Error 2 while executing fsck.ubifs for /dev/root
 done.

So it is indeed ignoring the fstab option I set for it:

/dev/root  / ubifs   defaults,noatime,rw   0 0


As to your question about fsck.ubifs, the answer to that can be found in
linux/Documentation/filesystems/ubifs.txt, the relevant part being:

 Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts.
 It does not need stuff like fsck.ext2. UBIFS automatically replays its
 journal and recovers from crashes, ensuring that the on-flash data
 structures are consistent.

It does that at boot before userspace is even entered (during the ubifs
probe kernelside).


So indeed, this probably should be an exception to the normal fsck.$type
case, though just respecting the fstab selection would probably be enough
as well.  Since there are quite few devices using ubifs and shipping with
Debian on them by default now, it would be nice to tick this one off for
the squeeze release if we can.

Cheers,
Ron






Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#571241; Package initscripts. (Sat, 14 Aug 2010 05:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 14 Aug 2010 05:48:04 GMT) Full text and rfc822 format available.

Message #25 received at 571241@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Ron <ron@debian.org>, 571241@bugs.debian.org
Subject: Re: Bug#571241: checkroot.sh: should not try to fsck rootfs on ubifs
Date: Sat, 14 Aug 2010 07:46:21 +0200
[Ron]
> So it is indeed ignoring the fstab option I set for it:
> 
> /dev/root  / ubifs   defaults,noatime,rw   0 0

If so, I suspect this is the same as bug #592427, which have an
untested fix in svn for version 2.88dsf-12 but not uploaded yet.

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#571241; Package initscripts. (Sat, 12 Feb 2011 15:15:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marcus Osdoba <marcus.osdoba@googlemail.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 12 Feb 2011 15:15:06 GMT) Full text and rfc822 format available.

Message #30 received at 571241@bugs.debian.org (full text, mbox):

From: Marcus Osdoba <marcus.osdoba@googlemail.com>
To: 571241@bugs.debian.org
Subject: Recent version still tries to check rootfs of type ubifs
Date: Sat, 12 Feb 2011 16:13:30 +0100
Hello,

I'm running a Squeeze rootfs on a ubifs partition. On bootup, I still 
get the error, that no fsck.ubifs could be found.

I created a fsck.ubifs with fsck.nfs as template:
http://gitorious.org/dockstar/emdebian-multistrap/blobs/master/customize_rootfs.sh#line116

Now I am prepared for any fsck.ubifs-attempts...


The ubifs-team does error correction within the kernel module. A 
fsck.ubifs will probably never exists:
http://www.mjmwired.net/kernel/Documentation/filesystems/ubifs.txt#59
http://lists.infradead.org/pipermail/linux-mtd/2010-February/029017.html

Is it ok for you, to create a dummy fsck.ubifs in parallel to fsck.nfs?

Regards,
Marcus




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 25 09:20:47 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.