fsck doesn't update system info on login

Bug #692355 reported by geeknik
220
This bug affects 45 people
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Fix Released
Medium
Canonical Foundations Team

Bug Description

Every time I login to my Ubuntu 11.04 Alpha 1 (server), I see this message:

*** /dev/sda5 will be checked for errors at next reboot ***

I have done both the 'touch /forcefsck' (file is gone after reboot) and I have done 'shutdown -rF now' and yet the message is still displayed. I checked my boot.log and fsck did run:

fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
/dev/mapper/sh*tbox1-root: clean, 103845/4669440 files, 1179707/18669568 blocks
/dev/sda5: clean, 245/124496 files, 83515/248976 blocks

Since fsck did run successfully, the '*** /dev/sda5 will be checked for errors at next reboot ***' message should not appear again unless the system has determined the filesystem is dirty. I seriously doubt that this not very old drive is having this many problems, especially since the OS runs 24/7 with no problems besides this.

lsb_release -rd:
Description: Ubuntu natty (development branch)
Release: 11.04

uname -a output:
Linux node1 2.6.37-10-server #24-Ubuntu SMP Thu Dec 16 18:10:40 UTC 2010 x86_64 GNU/Linux

Related branches

tags: added: alpha error fsck login natty
Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Assign to e2fsprogs as it seems a fsck issue

affects: ubuntu → e2fsprogs (Ubuntu)
Revision history for this message
Theodore Ts'o (tytso) wrote :

No, I don't think it's an e2fsprogs issue. It looks like it's an init scripts issue. Fsck should always run on boot, regardless of whether or not /forcefsck is set. What forcefsck should do is set the -f flag, to request a forced check even though the file system appears clean.

Revision history for this message
jgreenso (james-green-mjog) wrote :

I'm seeing this on an upgraded Natty vmware instance.

Relevant fstab entry:
UUID=cbdda93e-2d89-47be-9bee-ce24bf1376ce /boot ext3 relatime 0 2

touched /boot/forcefsck and rebooted - file still there.

boot.log says:
/sbin/fsck.xfs: XFS file system.
/sbin/fsck.xfs: XFS file system.
/dev/sda1: clean, 236/36144 files, 52572/144552 blocks

jamesg@ubuntu:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/myvg-system
                       10G 7.7G 2.4G 77% /
none 242M 180K 242M 1% /dev
none 249M 0 249M 0% /dev/shm
none 249M 356K 248M 1% /var/run
none 249M 0 249M 0% /var/lock
/dev/sda1 137M 47M 83M 37% /boot
/dev/mapper/myvg-mysqllv
                       30G 1.5G 29G 5% /var/lib/mysql

Revision history for this message
Paul McEnery (pmcenery) wrote :

I was affected by this and bug and discovered that it appears to be caused when the file /var/lib/update-notifier/fsck-at-reboot has a datestamp in the future. This will never rectify itself unless the actual date passes the datestamp on the file.

The attached patch fixes the problem.

Revision history for this message
Paul McEnery (pmcenery) wrote :

After applying the above patch; either reboot, or regenerate /var/lib/update-notifier/fsck-at-boot as follows:

$ sudo -s
# run-parts --lsbsysinit /etc/update-motd.d > /var/run/motd

tags: added: patch
Changed in e2fsprogs (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

It's actually update-notifier that provides update-motd-fsck-at-reboot.

affects: e2fsprogs (Ubuntu) → update-notifier (Ubuntu)
Changed in update-notifier (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in update-notifier (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Michael Vogt (mvo)
Changed in update-notifier (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 0.118ubuntu1

---------------
update-notifier (0.118ubuntu1) precise; urgency=low

  * fix "fsck doesn't update system info on login" LP: #692355
    Thanks to Paul McEnery
 -- Michael Vogt <email address hidden> Mon, 09 Jan 2012 12:58:55 +0100

Changed in update-notifier (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Nicholas Lee (nicholas-lee-n) wrote :

This bug still seems to exist in Ubuntu 12.04 LTS....

Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-24-generic-pae i686)

 * Documentation: https://help.ubuntu.com/

*** /dev/sdb1 will be checked for errors at next reboot ***
*** /dev/sdc1 will be checked for errors at next reboot ***

Last login: Thu May 3 09:14:20 2012

Revision history for this message
Steve Langasek (vorlon) wrote :

Looks like the bug is here in /usr/lib/update-notifier/update-motd-fsck-at-reboot:

# check time when we did the last check
stamp="/var/lib/update-notifier/fsck-at-reboot"
if [ -e "$stamp" ]; then
    stampt=$(stat -c %Y $stamp)
else
    stampt=0
fi

now=$(date +%s)
if [ $(($stampt + 3600)) -lt $now ] || [ $stampt -gt $now ]; then
    #echo $stampt $now need update
        NEEDS_FSCK_CHECK=yes
fi

If you log in on console triggering a refresh of the file, then reboot and get the fsck, then log in again once the system finishes booting, there will be a current stamp file and the check will not be re-run.

We should probably compare the file's timestamp with the uptime, and set NEEDS_FSCK_CHECK=yes if it's older than the last reboot.

Changed in update-notifier (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Berend Dekens (cyberwizzard) wrote :

On my media computer, I am running the latest updates for Ubuntu 11.10 and this fix is not released. Can we expect this to be back-ported to 11.10?

Revision history for this message
Chris Cote (1fpl) wrote :

I performed a remote server package upgrade (over SSH) to 12.04 from 10.04. I am effected by this bug too. I have no direct console access to the machine since it's 50+ miles away, only SSH.

Please take this into consideration when you troubleshoot this problem.

Thanks.

Revision history for this message
Anonymous Chief (anonymouschief) wrote :

Server 12.04. It is an upgrade from 11.10, which was installed via CD. I have tried setting FSCKFIX to "yes", no change. The /var/lib/update-notifier/fsck-at-reboot file has a date/time stamp set to May 22.
Touched /boot/forcefsck and rebooted - file still there.

will be checked for errors at next reboot *** still comes up on motd.

Revision history for this message
Curtis Bangert (codecae) wrote :

I had this issue with my logical filesystems after upgrading to 12.04 as well... fsck was mysteriously skipping filesystems at boot.

I fixed it by making sure each entry in /etc/fstab had the option 'errors=remount-ro', executed 'touch /forcefsck', and rebooted... To my delight, fsck ran and updated the mount count and last check dates.

Unfortunately, however, after logging in I still had the notification that the filesystems would be checked at reboot. I manually rm'd /var/lib/update-notifier/fsck-at-reboot and logged out and back in again. The file was regenerated by the script, only this time, without any notifications.

Given the nature of this oversight, I'm sure I would've likely encountered it whether or not I had upgraded to 12.04... likely a coincidence.

Revision history for this message
Guillaume Romagny (golfromeo.ovh) wrote :

hello,
(Ubuntu 11.10 "server")
it is not a big issue but it is a bit scary at first but the filesystem is not compromised!

tags: added: precise
Revision history for this message
Thorsten Rhau (thorre) wrote :

Upgraded from 10.04.4 to 12.04.1 yesterday and now i am getting these error messages as well. I have done an manual fsck but that does not help.

System seems fine.

thorre@ida:~$ uname -a
Linux ida 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
thorre@ida:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise
thorre@ida:~$

Revision history for this message
GouZi (jalliot) wrote :

Still there with:

$ uname -a
Linux merlin 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise

Revision history for this message
Christoph Lühr (cluehr) wrote :

I have the same issue on Ubuntu 12.10.

[cluehr@xxxx: /] $ uname -a
Linux D-TXL-00429084 3.5.0-18-generic #29-Ubuntu SMP Fri Oct 19 10:26:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[cluehr@xxxx: /] $ lsb_release -a
LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal

Revision history for this message
Jeremy LaCroix (j-jlacroix) wrote :

Same here with Ubuntu Server 12.04.

I tried rm'ing the file, but it did not fix it. I didn't run 'touch /forcefsck' because I am using LVM with a RAID1 config and not sure if that would mess everything up.

Revision history for this message
Andreas Ntaflos (daff) wrote :

Still a problem on 12.04.1. Removing /var/lib/update-notifier/fsck-at-reboot and logging out, then back in works. The /etc/motd is updated and no longer contains this misleading and wrong message about pending fscks.

Revision history for this message
Mark Wormgoor (markwo) wrote :

Having the same problem here on 12.10 with all updates installed. I fixed my fstab (one filesystem didn't have the check set) and did a touch /forcefsck. After the reboot, the message is still there, stating that my filesystems will be checked on reboot. However, I checked my filesystems, and they were both checked when I rebooted just now:
Last checked: Tue Jan 22 08:26:15 2013

Revision history for this message
Stephen (1012web) wrote :

If you want to remove the message from motd without rebooting here is the command to delete the file that has the problem message cached and fully regenerate the motd:

sudo bash -c 'rm /var/lib/update-notifier/fsck-at-reboot && for file in /etc/update-motd.d/*; do $file; done > /var/run/motd' && cat /etc/motd

tags: added: rls-s-tracking
Revision history for this message
maletin (maletin) wrote :

# dumpe2fs -h /dev/sdb1 | grep 'ount count'
dumpe2fs 1.42 (29-Nov-2011)
Mount count: 23
Maximum mount count: 20

~$ sudo sh -x /usr/lib/update-notifier/update-motd-fsck-at-reboot
[...]
Mount count: 23
Maximum mount count: 20
[...]
+ next_check_date= Tue Jul 23 09:21:20 2013
+ [ -z 0 ]
+ date -d Tue Jul 23 09:21:20 2013 +%s
+ next_check_tstamp=1374564080
+ check_occur=
+ [ 20 -gt 0 -a 23 -ge 20 ]
+ check_occur=yes
+ [ 15552000 -gt 0 -a 1374564080 -lt 1368184556 ]
+ [ -n yes ]
+ check_occur_any=yes
+ echo *** /dev/sdb1 will be checked for errors at next reboot ***
[...]

Revision history for this message
maletin (maletin) wrote :

$ grep 'home' /etc/fstab
# /home was on /dev/sda4 during installation
#UUID=cf9c1b11-5604-4b67-80bc-e9a2a082b220 /home ext4 defaults 0 2
/dev/sdb1 /home auto defaults 0 2

Revision history for this message
Steve Langasek (vorlon) wrote :

> # dumpe2fs -h /dev/sdb1 | grep 'ount count'
> dumpe2fs 1.42 (29-Nov-2011)
> Mount count: 23
> Maximum mount count: 20

Which means this is working exactly as designed.

Revision history for this message
maletin (maletin) wrote :

Steve Langasek (vorlon) wrote on 2013-05-11: #24

> Which means this is working exactly as designed.

correct. but why does my vmware not start a fsck after reboot (even with /forcefsck)?

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 692355] Re: fsck doesn't update system info on login

On Mon, May 13, 2013 at 09:27:06AM -0000, maletin wrote:
> Steve Langasek (vorlon) wrote on 2013-05-11: #24

> > Which means this is working exactly as designed.

> correct. but why does my vmware not start a fsck after reboot (even with
> /forcefsck)?

I don't know, but that seems to be describing a different issue than this
bug.

Changed in update-notifier (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 0.136

---------------
update-notifier (0.136) saucy; urgency=low

  [ Steve Langasek ]
  * If the /var/lib/update-notifier/fsck-at-reboot stamp file is older than
    the current uptime, any information about fscking at "next boot" is
    definitely stale - so force a refresh. LP: #692355.

  [ Brian Murray ]
  * Remove support for choosing not to auto-launch applications (LP: #947008)
  * Remove reboot required notification as update-manager itself indicates
    when a reboot is required and it only appeared when auto-launch was set to
    false.
  * Move update-notifier checking for CDs with packages into a new binary
    distro-cd-updater
  * Add an upstart user session job that runs upon CD insertion
  * Remove sections of uevent related to hp firmware and replace them with an
    upstart user session job
  * Modified avahi disabled notification to run as an upstart user session
  * Modified new release check to run as an upstart user session
  * Added in a weekly cron job to check for a new release of ubuntu
  * Added an upstart user session job to check for crashes
  * Ensure we ask before launching a pkexec dialog for an apport crash
 -- Brian Murray <email address hidden> Tue, 04 Jun 2013 10:08:21 -0700

Changed in update-notifier (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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