Please try harder when remounting in checkroot.sh

Bug #7086 reported by Debian Bug Importer
4
Affects Status Importance Assigned to Milestone
sysvinit (Debian)
Fix Released
Unknown
sysvinit (Ubuntu)
Invalid
High
Unassigned

Bug Description

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

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

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

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

Message-Id: <1090081294.24198.26.camel@glue>
Date: Sat, 17 Jul 2004 12:21:35 -0400
From: "Grzegorz B. Prokopski" <email address hidden>
To: <email address hidden>
Subject: Please try harder when remounting in checkroot.sh

Package: initscripts
Version: 2.85-22
Severity: serious
Justification: Makes some systems unusable until fixed by hand.

In last few days I have seen the below problem happening on _several_
machines: sparc, kernel 2.4.21, ext3.

After an upgrade and a reboot I was getting errors from
/etc/init.d/checkroot.sh that made system unusable. There were
mainly two problems:

1. At first checkroot.sh tried to remount root read-only which
   apparently failed and caused this error:

"You must specify the filesystem type"

   which in turn caused this warning:

"*** ERROR! Cannot fsck root fs because it is not mounted read-only!"

2. But apparently the root already was in ro mode and what's worse,
   the script failed to remount root in rw mode, so I got flooded with
   errors from starting services and others that filesystem is
   read-only and they were unable to write anything to it.

I've read in BTS about troubles with remounting root caused by bugs (or
differences) in older kernels and on different architectures. The
fix I did in checkroot.sh should not affect any platforms/machines
on which current checkroot.sh works.

I modified remounting root read-only in the following way:

if [ "$rootcheck" = yes ]
then
        #
        # Ensure that root is quiescent and read-only before fsck'ing.
        #
        if ! mount -n -o remount,ro $rootdev /
        then
            if ! mount -n -o remount,ro /
            then
                echo -n "*** ERROR! Cannot fsck root fs because it is "
                echo "not mounted read-only!"
                echo
                rootcheck=no
            fi
        fi
fi

And then remounting root read-write similarly:
#
# Remount root to final mode (rw or ro).
#
if ! mount -n -o remount,$rootopts,$rootmode $fstabroot /
then
    mount -n -o remount,$rootopts,$rootmode /
fi

I am still getting "You must specify the filesystem type" error,
probably from the first remount, but the second try succeeds and
the system is able to come up like it used to do.

Please note, that this additional remount is only executed when
the first try fails, so it will not affect at all any configurations
in which the current script works well.

Hope this helps,

   Grzegorz B. Prokopski
--
Grzegorz B. Prokopski <email address hidden>
Debian GNU/Linux http://www.debian.org
SableVM - LGPL'ed Java VM http://www.sablevm.org
Why SableVM ?!? http://devel.sablevm.org/wiki/Features

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

i have never seen this happening on any of my systems.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I have heard of similar things before, but never experienced it myself. This
particular case happened on sparc...

Revision history for this message
Matt Zimmerman (mdz) wrote :

I think this is an indication of some sort of kernel/initrd screwup...it would
be nice to have confirmation from someone closer to the problem, though

Revision history for this message
In , Matt Zimmerman (mdz) wrote :

This seems to be related to the fix for #239735. Your modifications (as
best I can tell at a glance, since you didn't provide a diff) try the
current method first, and then if it fails, try the old method.

This would still produce some alarming error messages in this case, though.
What architecture are you using, and what version of mount? #239735 seems
to say that this is actually a bug elsewhere in the system.

--
 - mdz

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

Message-ID: <email address hidden>
Date: Mon, 26 Jul 2004 14:30:53 -0700
From: Matt Zimmerman <email address hidden>
To: <email address hidden>
Cc: "Grzegorz B. Prokopski" <email address hidden>
Subject: Re: Please try harder when remounting in checkroot.sh

This seems to be related to the fix for #239735. Your modifications (as
best I can tell at a glance, since you didn't provide a diff) try the
current method first, and then if it fails, try the old method.

This would still produce some alarming error messages in this case, though.
What architecture are you using, and what version of mount? #239735 seems
to say that this is actually a bug elsewhere in the system.

--
 - mdz

Revision history for this message
Matt Zimmerman (mdz) wrote :

No evidence that this affects Warty architectures so far; submitter is
unresponsive. Downgrading.

Revision history for this message
In , Ian Gulliver (ian-penguinhosting) wrote : Issue Reintroduced

Severity: critical
Justification: prevents the system from coming up
Tags: sarge

This issue was fixed in sysvinit-2.85-13, closing bug #239735, but
reintroduced in 2.85-21 in response to bug #254724. sparc is back to
experiencing the same issues:

--------------------
mount: you must specify the filesystem type
*** ERROR! Cannot fsck root fs because it is not mounted read-only!

mount: you must specify the filesystem type
--------------------

This is a clean 3.0R2 install, dist-upgraded to testing immediately
after install (today), and immediately rebooted.

--
Ian Gulliver
Penguin Hosting
"Failure is not an option; it comes bundled with your Microsoft products."

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

Message-ID: <email address hidden>
Date: Thu, 29 Jul 2004 16:20:06 +0000
From: Ian Gulliver <email address hidden>
To: <email address hidden>
Subject: Issue Reintroduced

--b1450902dea57c6abdb8499a60427595
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="6WlEvdN9Dv0WHSBl"

--6WlEvdN9Dv0WHSBl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Severity: critical
Justification: prevents the system from coming up
Tags: sarge

This issue was fixed in sysvinit-2.85-13, closing bug #239735, but
reintroduced in 2.85-21 in response to bug #254724. sparc is back to
experiencing the same issues:

--------------------
mount: you must specify the filesystem type
*** ERROR! Cannot fsck root fs because it is not mounted read-only!

mount: you must specify the filesystem type
--------------------

This is a clean 3.0R2 install, dist-upgraded to testing immediately
after install (today), and immediately rebooted.

--=20
Ian Gulliver
Penguin Hosting
"Failure is not an option; it comes bundled with your Microsoft products."

--6WlEvdN9Dv0WHSBl
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBCSO2efI+qeoOjxURAlwtAJ9BE4hAAVM94hfzlmlLp1ssSQJDQACgjD3Q
5dC5iu4V2M6lvEtaqZUXJfQ=
=D2uJ
-----END PGP SIGNATURE-----

--6WlEvdN9Dv0WHSBl--

--b1450902dea57c6abdb8499a60427595
Content-Type: application/postage-hashcash
Version: 1.1
Mint-Hash: ySytfVjkj9/U2I8YncLR494N0+Y=
To: <email address hidden>
Date: 20040729T16:20:06
Amount: 24

3e899c
--b1450902dea57c6abdb8499a60427595--

Revision history for this message
Matt Zimmerman (mdz) wrote :

OK, maybe this is important after all. I still have no idea how to reproduce
it, though.

Revision history for this message
In , Thomas Hood (jdthood-aglu) wrote : merge

severity 259979 normal
tags 259979 wontfix
merge 259979 255230
thanks

I am merging #259979 with #255230 which is marked 'wontfix'
because the problem has been fixed at the kernel level.
Miquel may still want to take a look at the code provided in
#259979, though.

--
Thomas
Hood

Revision history for this message
In , Miquel van Smoorenburg (miquels) wrote : Re: Bug#259979: merge

On Thu, 29 Jul 2004 23:31:32, <email address hidden> wrote:
> severity 259979 normal
> tags 259979 wontfix
> merge 259979 255230
> thanks
>
> I am merging #259979 with #255230 which is marked 'wontfix'
> because the problem has been fixed at the kernel level.
> Miquel may still want to take a look at the code provided in
> #259979, though.

In fact, I did look at that and in the pending -23 I have
taken that approach. Code sample:

        #
        # Ensure that root is quiescent and read-only before fsck'ing.
        #
        # mount -n -o remount,ro / would be the correct syntax but
        # mount can get confused when there is a "bind" mount defined
        # in fstab that bind-mounts "/" somewhere else.
        #
        # So we use mount -n -o remount,ro $rootdev / but that can
        # fail on older kernels on sparc64/alpha architectures due
        # to a bug in sys_mount().
        #
        # As a compromise we try both.
        #
        if ! mount -n -o remount,ro $rootdev / 2>/dev/null &&
           ! mount -n -o remount,ro /
        then
  ....

Mike.

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

Message-Id: <email address hidden>
Date: Thu, 29 Jul 2004 21:31:32 GMT
From: <email address hidden>
To: <email address hidden>
Cc: <email address hidden>, <email address hidden>
Subject: merge

severity 259979 normal
tags 259979 wontfix
merge 259979 255230
thanks

I am merging #259979 with #255230 which is marked 'wontfix'
because the problem has been fixed at the kernel level.
Miquel may still want to take a look at the code provided in
#259979, though.

--
Thomas
Hood

Revision history for this message
Matt Zimmerman (mdz) wrote :

wontfix in Debian; apparently it's fixed in the kernel and probably doesn't
affect Warty's 2.6

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

Message-ID: <email address hidden>
Date: Fri, 30 Jul 2004 00:48:04 +0200
From: Miquel van Smoorenburg <email address hidden>
To: <email address hidden>
Cc: <email address hidden>, <email address hidden>
Subject: Re: Bug#259979: merge

On Thu, 29 Jul 2004 23:31:32, <email address hidden> wrote:
> severity 259979 normal
> tags 259979 wontfix
> merge 259979 255230
> thanks
>
> I am merging #259979 with #255230 which is marked 'wontfix'
> because the problem has been fixed at the kernel level.
> Miquel may still want to take a look at the code provided in
> #259979, though.

In fact, I did look at that and in the pending -23 I have
taken that approach. Code sample:

        #
        # Ensure that root is quiescent and read-only before fsck'ing.
        #
        # mount -n -o remount,ro / would be the correct syntax but
        # mount can get confused when there is a "bind" mount defined
        # in fstab that bind-mounts "/" somewhere else.
        #
        # So we use mount -n -o remount,ro $rootdev / but that can
        # fail on older kernels on sparc64/alpha architectures due
        # to a bug in sys_mount().
        #
        # As a compromise we try both.
        #
        if ! mount -n -o remount,ro $rootdev / 2>/dev/null &&
           ! mount -n -o remount,ro /
        then
  ....

Mike.

Revision history for this message
In , Miquel van Smoorenburg (miquels) wrote : Bug#259979: fixed in sysvinit 2.86-1
Download full text (3.3 KiB)

Source: sysvinit
Source-Version: 2.86-1

We believe that the bug you reported is fixed in the latest version of
sysvinit, which is due to be installed in the Debian FTP archive:

initscripts_2.86-1_i386.deb
  to pool/main/s/sysvinit/initscripts_2.86-1_i386.deb
sysv-rc_2.86-1_all.deb
  to pool/main/s/sysvinit/sysv-rc_2.86-1_all.deb
sysvinit_2.86-1.diff.gz
  to pool/main/s/sysvinit/sysvinit_2.86-1.diff.gz
sysvinit_2.86-1.dsc
  to pool/main/s/sysvinit/sysvinit_2.86-1.dsc
sysvinit_2.86-1_i386.deb
  to pool/main/s/sysvinit/sysvinit_2.86-1_i386.deb
sysvinit_2.86.orig.tar.gz
  to pool/main/s/sysvinit/sysvinit_2.86.orig.tar.gz

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Miquel van Smoorenburg <email address hidden> (supplier of updated sysvinit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----

Format: 1.7
Date: Fri, 30 Jul 2004 14:17:05 +0200
Source: sysvinit
Binary: sysv-rc sysvinit initscripts
Architecture: source i386 all
Version: 2.86-1
Distribution: unstable
Urgency: medium
Maintainer: Miquel van Smoorenburg <email address hidden>
Changed-By: Miquel van Smoorenburg <email address hidden>
Description:
 initscripts - Standard scripts needed for booting and shutting down
 sysv-rc - Standard boot mechanism using symlinks in /etc/rc?.d
 sysvinit - System-V like init
Closes: 244908 248210 250089 255303 255820 255849 255880 256726 258065 259971 259979 261342
Changes:
 sysvinit (2.86-1) unstable; urgency=medium
 .
   * Better algorithm for pidof (closes: #248210)
   * Include fsck.nfs.8 (closes: #250089)
   * Include new skeleton script (closes: #244908)
   * Better error message on failure to find path to mtab (closes: #255820)
   * Add support for fstype ncp (alias for ncpfs) (closes: #259971)
   * Touch /tmp/.clean earlier (closes: #255303)
   * Don't include halt and reboot for hurd-i386 (closes: #255880)
   * Remove XSIisms in mountvirtfs and invoke-rc.d (closes: #256726)
   * Add "-t $roottype" to mount -f for / (closes: #255849)
   * Always initialize PATH (to /bin:/usr/bin:/sbin:/usr/sbin) (closes: #258065)
   * Try harder to remount ro and rw (closes: #259979)
   * Add support for LABEL=/UUID= in checkroot.sh (closes: #261342)
Files:
 cbb7b8ffd2d05103087d26fc84c3300e 643 base required sysvinit_2.86-1.dsc
 e27bd78e92443b59d743f261f4a51f57 182051 base required sysvinit_2.86.orig.tar.gz
 73803f3b8d7bb4bc3d4ac9589c8b2ff6 58956 base required sysvinit_2.86-1.diff.gz
 5916bdf9469cca6a46e3538f32c5b678 96740 base required sysvinit_2.86-1_i386.deb
 f9e19cb06699c3879cb55013288f190f 29836 base required initscripts_2.86-1_i386.deb
 9115b0d88d2bd7ba586cf1c2e15e05ee 34710 base required sysv-rc_2.86-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQB1AwUBQQuhdFiLscT2F1RZAQE5w...

Read more...

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (3.5 KiB)

Message-Id: <email address hidden>
Date: Sat, 31 Jul 2004 09:49:55 -0400
From: Miquel van Smoorenburg <email address hidden>
To: <email address hidden>
Subject: Bug#259979: fixed in sysvinit 2.86-1

Source: sysvinit
Source-Version: 2.86-1

We believe that the bug you reported is fixed in the latest version of
sysvinit, which is due to be installed in the Debian FTP archive:

initscripts_2.86-1_i386.deb
  to pool/main/s/sysvinit/initscripts_2.86-1_i386.deb
sysv-rc_2.86-1_all.deb
  to pool/main/s/sysvinit/sysv-rc_2.86-1_all.deb
sysvinit_2.86-1.diff.gz
  to pool/main/s/sysvinit/sysvinit_2.86-1.diff.gz
sysvinit_2.86-1.dsc
  to pool/main/s/sysvinit/sysvinit_2.86-1.dsc
sysvinit_2.86-1_i386.deb
  to pool/main/s/sysvinit/sysvinit_2.86-1_i386.deb
sysvinit_2.86.orig.tar.gz
  to pool/main/s/sysvinit/sysvinit_2.86.orig.tar.gz

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Miquel van Smoorenburg <email address hidden> (supplier of updated sysvinit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----

Format: 1.7
Date: Fri, 30 Jul 2004 14:17:05 +0200
Source: sysvinit
Binary: sysv-rc sysvinit initscripts
Architecture: source i386 all
Version: 2.86-1
Distribution: unstable
Urgency: medium
Maintainer: Miquel van Smoorenburg <email address hidden>
Changed-By: Miquel van Smoorenburg <email address hidden>
Description:
 initscripts - Standard scripts needed for booting and shutting down
 sysv-rc - Standard boot mechanism using symlinks in /etc/rc?.d
 sysvinit - System-V like init
Closes: 244908 248210 250089 255303 255820 255849 255880 256726 258065 259971 259979 261342
Changes:
 sysvinit (2.86-1) unstable; urgency=medium
 .
   * Better algorithm for pidof (closes: #248210)
   * Include fsck.nfs.8 (closes: #250089)
   * Include new skeleton script (closes: #244908)
   * Better error message on failure to find path to mtab (closes: #255820)
   * Add support for fstype ncp (alias for ncpfs) (closes: #259971)
   * Touch /tmp/.clean earlier (closes: #255303)
   * Don't include halt and reboot for hurd-i386 (closes: #255880)
   * Remove XSIisms in mountvirtfs and invoke-rc.d (closes: #256726)
   * Add "-t $roottype" to mount -f for / (closes: #255849)
   * Always initialize PATH (to /bin:/usr/bin:/sbin:/usr/sbin) (closes: #258065)
   * Try harder to remount ro and rw (closes: #259979)
   * Add support for LABEL=/UUID= in checkroot.sh (closes: #261342)
Files:
 cbb7b8ffd2d05103087d26fc84c3300e 643 base required sysvinit_2.86-1.dsc
 e27bd78e92443b59d743f261f4a51f57 182051 base required sysvinit_2.86.orig.tar.gz
 73803f3b8d7bb4bc3d4ac9589c8b2ff6 58956 base required sysvinit_2.86-1.diff.gz
 5916bdf9469cca6a46e3538f32c5b678 96740 base required sysvinit_2.86-1_i386.deb
 f9e19cb06699c3879cb55013288f190f 2...

Read more...

Changed in sysvinit:
status: Unknown → Fix Released
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.