util-linux: System time is not set correctly prior to root filesystem fsck

Bug #28016 reported by Debian Bug Importer
6
Affects Status Importance Assigned to Milestone
util-linux (Debian)
Fix Released
Unknown
util-linux (Ubuntu)
Invalid
High
LaMont Jones

Bug Description

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

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

Message-ID: <email address hidden>
Date: Fri, 16 Dec 2005 15:41:20 -0500
From: Rick Friedman <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: e2fsprogs: Last write time in future error during boot up

Package: e2fsprogs
Version: 1.38+1.39-WIP-2005.12.10-1
Severity: normal

Since upgrading to version 1.38+1.39-WIP-2005.12.10-1, whenever I boot
up, the following error is displayed:

/: Superblock last write time is in the future

The date & time on my system is kept in Eastern time (the hardware clock
that is). /etc/default/rcS has the following line: UTC=no

What is the cause of this error? I have a dual boot system with Windows.
Do I need to change how the clock is setup? If so, how?

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-1-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages e2fsprogs depends on:
ii e2fslibs 1.38+1.39-WIP-2005.12.10-1 ext2 filesystem libraries
ii libblkid1 1.38+1.39-WIP-2005.12.10-1 block device id library
ii libc6 2.3.5-8.1 GNU C Library: Shared libraries an
ii libcomerr2 1.38+1.39-WIP-2005.12.10-1 common error description library
ii libss2 1.38+1.39-WIP-2005.12.10-1 command-line interface parsing lib
ii libuuid1 1.38+1.39-WIP-2005.12.10-1 universally unique id library

e2fsprogs recommends no packages.

-- no debconf information

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

Message-ID: <email address hidden>
Date: Sat, 17 Dec 2005 19:45:42 -0500
From: Theodore Ts'o <email address hidden>
To: Rick Friedman <email address hidden>, <email address hidden>
Subject: Re: Bug#343645: e2fsprogs: Last write time in future error during boot up

On Fri, Dec 16, 2005 at 03:41:20PM -0500, Rick Friedman wrote:
> Package: e2fsprogs
> Version: 1.38+1.39-WIP-2005.12.10-1
> Severity: normal
>
>
> Since upgrading to version 1.38+1.39-WIP-2005.12.10-1, whenever I boot
> up, the following error is displayed:
>
> /: Superblock last write time is in the future
>
> The date & time on my system is kept in Eastern time (the hardware clock
> that is). /etc/default/rcS has the following line: UTC=no
>
> What is the cause of this error? I have a dual boot system with Windows.
> Do I need to change how the clock is setup? If so, how?

Sigh, I see what's going on. Unfortunately S22hwclockfirst.sh gets
done *after* S10checkroot. So the system time is still incorrect when
we check the root filesystem; it doesn't get adjusted to account for
the fact that you're using a non-GMT time until afterwards. I run
with my hardware clock set to UTC, so I didn't notice this problem.

Could you try renaming /etc/rcS.d/S22hwclockfirst.sh to
/etc/rcS.d/S09hwclockfirst.sh and see if this addresses your problem?

      - Ted

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

Message-ID: <email address hidden>
Date: Sat, 17 Dec 2005 19:50:43 -0500
From: Theodore Ts'o <email address hidden>
To: Rick Friedman <email address hidden>, <email address hidden>
Subject: Re: Bug#343645: e2fsprogs: Last write time in future error during boot up

On Sat, Dec 17, 2005 at 07:45:42PM -0500, Theodore Ts'o wrote:
> Sigh, I see what's going on. Unfortunately S22hwclockfirst.sh gets
> done *after* S10checkroot. So the system time is still incorrect when
> we check the root filesystem; it doesn't get adjusted to account for
> the fact that you're using a non-GMT time until afterwards. I run
> with my hardware clock set to UTC, so I didn't notice this problem.
>
> Could you try renaming /etc/rcS.d/S22hwclockfirst.sh to
> /etc/rcS.d/S09hwclockfirst.sh and see if this addresses your problem?
>

Oops, I just realized, this won't work if /usr is a separately mounted
filesystem, since /etc/localtime is a typically a symlink to
/usr/share/zoneinfo/<timezome>, and at the time when the root
filesystem is checked, any other filesystems (such as possibly /usr)
won't be mounted yet.

      - Ted

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

Message-id: <email address hidden>
Date: Sun, 18 Dec 2005 07:19:34 -0500
From: Rick Friedman <email address hidden>
To: Theodore Ts'o <email address hidden>
Cc: <email address hidden>
Subject: Re: Bug#343645: e2fsprogs: Last write time in future error during boot
 up

On Sat December 17 2005 07:50 pm, Theodore Ts'o wrote:
> On Sat, Dec 17, 2005 at 07:45:42PM -0500, Theodore Ts'o wrote:
> > Sigh, I see what's going on. Unfortunately S22hwclockfirst.sh gets
> > done *after* S10checkroot. So the system time is still incorrect when
> > we check the root filesystem; it doesn't get adjusted to account for
> > the fact that you're using a non-GMT time until afterwards. I run
> > with my hardware clock set to UTC, so I didn't notice this problem.
> >
> > Could you try renaming /etc/rcS.d/S22hwclockfirst.sh to
> > /etc/rcS.d/S09hwclockfirst.sh and see if this addresses your problem?
>
> Oops, I just realized, this won't work if /usr is a separately mounted
> filesystem, since /etc/localtime is a typically a symlink to
> /usr/share/zoneinfo/<timezome>, and at the time when the root
> filesystem is checked, any other filesystems (such as possibly /usr)
> won't be mounted yet.

Actually, I don't have /usr as a separate partition. I just have two
partitions, one for / and one for /home. So I tried your suggestion.
Interestingly, I had two symlinks to two different scripts in /etc/rcS.d
which did the same thing. One was S22hwclock.sh and the other was
S18hwclockfirst.sh. They were exactly the same scripts. So, I removed the
symlink, S22hwclock.sh (as well as the script hwclock.sh in /etc/init.d). I
then changed the S18hwclockfirst.sh symlink to S09hwclockfirst.sh.

I then booted into Windows and then booted back into Debian Sid. Previously,
doing so would trigger the Superblock error on bootup. However, this time, no
error was triggered. Bootup went smoothly.

So, this workaround was perfect for me. However, it would seem that a more
general fix is necessary for others. I imagine this would mean having to
change the boot setup for Debian.

Rick

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

Message-Id: <email address hidden>
Date: Fri, 30 Dec 2005 23:02:09 -0800
From: <email address hidden> (Theodore Y. Ts'o)
To: <email address hidden>
Subject: Bug#343645: fixed in e2fsprogs 1.38+1.39-WIP-2005.12.10-2

Source: e2fsprogs
Source-Version: 1.38+1.39-WIP-2005.12.10-2

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

comerr-dev_2.1-1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/comerr-dev_2.1-1.38+1.39-WIP-2005.12.10-2_i386.deb
e2fsck-static_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/e2fsck-static_1.38+1.39-WIP-2005.12.10-2_i386.deb
e2fslibs-dev_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/e2fslibs-dev_1.38+1.39-WIP-2005.12.10-2_i386.deb
e2fslibs_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/e2fslibs_1.38+1.39-WIP-2005.12.10-2_i386.deb
e2fsprogs-udeb_1.38+1.39-WIP-2005.12.10-2_i386.udeb
  to pool/main/e/e2fsprogs/e2fsprogs-udeb_1.38+1.39-WIP-2005.12.10-2_i386.udeb
e2fsprogs_1.38+1.39-WIP-2005.12.10-2.diff.gz
  to pool/main/e/e2fsprogs/e2fsprogs_1.38+1.39-WIP-2005.12.10-2.diff.gz
e2fsprogs_1.38+1.39-WIP-2005.12.10-2.dsc
  to pool/main/e/e2fsprogs/e2fsprogs_1.38+1.39-WIP-2005.12.10-2.dsc
e2fsprogs_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/e2fsprogs_1.38+1.39-WIP-2005.12.10-2_i386.deb
libblkid-dev_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/libblkid-dev_1.38+1.39-WIP-2005.12.10-2_i386.deb
libblkid1-udeb_1.38+1.39-WIP-2005.12.10-2_i386.udeb
  to pool/main/e/e2fsprogs/libblkid1-udeb_1.38+1.39-WIP-2005.12.10-2_i386.udeb
libblkid1_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/libblkid1_1.38+1.39-WIP-2005.12.10-2_i386.deb
libcomerr2_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/libcomerr2_1.38+1.39-WIP-2005.12.10-2_i386.deb
libss2_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/libss2_1.38+1.39-WIP-2005.12.10-2_i386.deb
libuuid1-udeb_1.38+1.39-WIP-2005.12.10-2_i386.udeb
  to pool/main/e/e2fsprogs/libuuid1-udeb_1.38+1.39-WIP-2005.12.10-2_i386.udeb
libuuid1_1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/libuuid1_1.38+1.39-WIP-2005.12.10-2_i386.deb
ss-dev_2.0-1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/ss-dev_2.0-1.38+1.39-WIP-2005.12.10-2_i386.deb
uuid-dev_1.2-1.38+1.39-WIP-2005.12.10-2_i386.deb
  to pool/main/e/e2fsprogs/uuid-dev_1.2-1.38+1.39-WIP-2005.12.10-2_i386.deb

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.
Theodore Y. Ts'o <email address hidden> (supplier of updated e2fsprogs 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-----
Hash: SHA1

Format: 1.7
Date: Sat, 31 Dec 2005 01:05:35 -0500
Source: e2fspr...

Read more...

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

Message-ID: <email address hidden>
Date: Wed, 04 Jan 2006 21:52:39 +0100
From: mahashakti89 <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: e2fsprogs: Superblock last mount time is in the future, fix it ? (Y)

Package: e2fsprogs
Version: 1.38+1.39-WIP-2005.12.10-2
Followup-For: Bug #343645

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (750, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-ck6
Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)

Versions of packages e2fsprogs depends on:
ii e2fslibs 1.38+1.39-WIP-2005.12.10-2 ext2 filesystem libraries
ii libblkid1 1.38+1.39-WIP-2005.12.10-2 block device id library
ii libc6 2.3.5-11 GNU C Library: Shared libraries an
ii libcomerr2 1.38+1.39-WIP-2005.12.10-2 common error description library
ii libss2 1.38+1.39-WIP-2005.12.10-2 command-line interface parsing lib
ii libuuid1 1.38+1.39-WIP-2005.12.10-2 universally unique id library

e2fsprogs recommends no packages.

-- no debconf information

I will make it short, I posted on debian-user-french to solve the
problem mentioned in the subject. It seemed to be a so strange
error ... I looked to the changelog.Debian.gz in /usr/share/doc and
also on http://bugs.debian.org to read the bug reports .

The error is following, sometimes , not all the time, at the end of the
boot process I get following error message : "/sbin/init : Cannot
execute binary file "
"Respawning too fast, disabled for five minutes"

I have to reboot, in recovery mode, to umount my / , and to do manually
#fsck /dev/hdb3 , then I get this error : Superblock last mount time is
in the future, fix it (Y)
After this I can boot without any problem.

The date & time on my system is set on Western time . /etc/default/rcS has the following line: UTC=no

How can I fix this ??

Thanks for all

Sorry for my english

mahashakti89

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

Message-ID: <email address hidden>
Date: Wed, 4 Jan 2006 21:33:59 -0500
From: Theodore Ts'o <email address hidden>
To: mahashakti89 <email address hidden>, <email address hidden>
Cc: <email address hidden>
Subject: Re: Bug#343645: e2fsprogs: Superblock last mount time is in the future, fix it ? (Y)

reassign 343645 initscripts
thanks

On Wed, Jan 04, 2006 at 09:52:39PM +0100, mahashakti89 wrote:
>
> I will make it short, I posted on debian-user-french to solve the
> problem mentioned in the subject. It seemed to be a so strange
> error ... I looked to the changelog.Debian.gz in /usr/share/doc and
> also on http://bugs.debian.org to read the bug reports .
>
> The error is following, sometimes , not all the time, at the end of the
> boot process I get following error message : "/sbin/init : Cannot
> execute binary file "
> "Respawning too fast, disabled for five minutes"

If this is happening all the time, and it's fixed by running by
running e2fsck, then you have something causing filesystem corruption
problems. This could be a hardware problem, or perhaps a buggy kernel
or a buggy device driver. It could also be a some kind of
configuration error. Is e2fsck actually giving you some kind of
filesystem corruption problem other than "superblock last mount time
is in the future?"

> I have to reboot, in recovery mode, to umount my / , and to do manually
> #fsck /dev/hdb3 , then I get this error : Superblock last mount time is
> in the future, fix it (Y)
> After this I can boot without any problem.
>
> The date & time on my system is set on Western time . /etc/default/rcS has the following line: UTC=no
>

This error is not an e2fsck bug, but a bug in the initscripts if you
use UTC=no. The problem is that the init scripts run a large portion
of the init scripts, including the initial e2fsck, with the wrong time
set. This is because /etc/localtime is a symlink to
/usr/share/zoneinfox/xxx, and /usr might not be mounted yet.

So if you use UTC=no, the system clock is set incorrectly until much
later in the boot process, thus triggering the e2fsck warning message.
It's harmless, and it's caused by this bug in the init scripts; e2fsck
requires that the time be correctly set when it is run.

What needs to happen with the init scripts is that the localtime
should be set in /etc/localtime.conf, and /etc/localtime should be a
copy of /usr/local/zoneinfo/`cat /etc/localtime.conf`; then the system
clock can be set correctly before e2fsck is run.

You can work around the problem by setting your hardware clock to UTC,
by setting /etc/default/rcS with the line: UTC=yes. The only reason
why this would be problematic is if you dual-boot Windows.

Regards,

      - Ted

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

Message-ID: <email address hidden>
Date: Thu, 05 Jan 2006 11:26:25 +0100
From: Thomas Hood <email address hidden>
To: Theodore Ts'o <email address hidden>
Cc: sysvinit maintainers <email address hidden>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#343645: e2fsprogs: Superblock
 last mount time is in the future, fix it ? (Y)

clone 343645 -1
reassign -1 util-linux
retitle -1 util-linux: System time is not set correctly prior to root filesystem fsck
severity -1 serious
merge -1 342887
retitle 343645 initscripts: Please work around util-linux's broken clock-setting
severity 343645 wishlist
stop

Debian Bug Tracking System wrote:
> reassign 343645 initscripts

The hwclock initscripts are in the util-linux package. There is already a bug
report (#342887) open against util-linux pointing out that the S22hwclock.sh
script requires /usr but runs before /usr is mounted, with the result being that
the system time is not set correctly on some systems. The bug reported here is
related to that one, so I am merging a clone of this report to that one.

While I would hope that this problem would be fixed in util-linux, we should
consider working around the problem somehow in the initscripts package.
--
Thomas

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

Message-ID: <email address hidden>
Date: Thu, 05 Jan 2006 11:36:36 +0100
From: Thomas Hood <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#343645: e2fsprogs: Superblock
 last mount time is in the future, fix it ? (Y)

reopen 346064
merge 346064 342887
reopen 343645
stop

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

Marking as duplicate based on debbugs merge (342887,346064)

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

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

Message-ID: <email address hidden>
Date: Thu, 5 Jan 2006 21:37:59 -0200
From: Henrique de Moraes Holschuh <email address hidden>
To: <email address hidden>
Subject: [PATCH] move hwclock to S05 and S46. Fix initscript problems

--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

tag 342887 + patch
thanks

See attached patch. It was not completely tested yet, but it seems sane,
and it survived some light testing.

Note that hwclock.sh runs much later than I'd like it to, but we need to
make sure /usr is mounted, and that means it must run after NFS has had its
change of mounting /usr.

USER'S GUIDE:

1. Install util-linux with the patch applied
2. Edit hwclockfirst.sh and set TZ to your timezone
3. Change that TZ according to daylight savings time, manually.

The TZ hack will be uncessary eventually, and util-linux will be fixed
accordingly to not mention TZ anymore in the initscript (dpkg will warn you
that the initscript conffile has changed). When that happens, please update
the initscript.

--
  "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

--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="util-linux-hwclock.diff"

diff -ruN util-linux-2.12r/debian/hwclock.sh util-linux-2.12r-fix2/debian/hwclock.sh
--- util-linux-2.12r/debian/hwclock.sh 2006-01-05 09:17:51.677942513 -0200
+++ util-linux-2.12r-fix2/debian/hwclock.sh 2006-01-05 20:41:58.799569064 -0200
@@ -11,6 +11,12 @@
 # during startup/shutdown.
 # - Added comments to alert users of hwclock issues
 # and discourage tampering without proper doc reading.
+# 2006-01-05 Henrique M. Holschuh <email address hidden>
+# - Improve message handling
+# - Fix FIRST=yes/no invocations of hwclock --hctosys,
+# and other minor things
+# - Make very sure /etc/adjtime is not used on FIRST=yes
+# - Follow symlinks in /etc/adjtime (no reason not to)

 # WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock
 # before changing this file. You risk serious clock
@@ -22,8 +28,15 @@
 # as machine hardware clock type for Alphas.
 HWCLOCKPARS=

+# Set this to your timezone if your clock is not in UTC, this hack will go
+# away soon. Make sure to use the simplest form for TZ, see tzset(3) for
+# details
+# e.g. TZ=ABC+03:00 for GMT-3:00, TZ=AAA-05:30 for UTC+05:30
+#
+#TZ=
+
 [ ! -x /sbin/hwclock ] && exit 0
-. /etc/default/rcS
+[ -r /etc/default/rcS ] && . /etc/default/rcS

 . /lib/lsb/init-functions
 verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
@@ -34,7 +47,9 @@
   UTC=""
   if [ "X$FIRST" = "Xyes" ] && [ ! -r /etc/localtime ]; then
       if [ -z "$TZ" ]; then
- log_action_msg "System clock was not updated at this time"
+ log_warning_msg "Hardware clock misconfiguration detected!"
+ log_warning_msg "Hardware clock not in UTC, TZ unset and /etc/localtime unreadable"
+ log_failure_msg "System clock was not updated at this time"
    exit 1
       fi
   fi
@@ -42,55 +57,65...

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

Message-ID: <email address hidden>
Date: Fri, 06 Jan 2006 14:15:16 +0100
From: Thomas Hood <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: housekeeping

severity 344818 serious
tags 344818 patch
merge 344818 342887
retitle 300559 util-linux: hwclock hangs up Dell PW 670
retitle 339831 util-linux: [hwclock] Typos in hwclock.sh
stop

Changed in util-linux:
status: Unconfirmed → Fix Released
Changed in util-linux:
status: Fix Released → Unconfirmed
Changed in util-linux:
status: Unconfirmed → 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.