linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [bugreport] Ext4 automatically checked at each boot
Date: Wed, 1 Jan 2020 09:17:48 -0500	[thread overview]
Message-ID: <20200101141748.GA191637@mit.edu> (raw)
In-Reply-To: <CABXGCsODr3tMpQxJ_nhWQQg5WGakFt4Yu5B8ev6ErOkc+zv9kA@mail.gmail.com>

On Wed, Jan 01, 2020 at 03:58:25PM +0500, Mikhail Gavrilov wrote:
> Hi folks.
> 
> Strange things happen with my ext4 lately:
> - At each boot, the file system is checked.
> - When I launch fsck manually it didn't found any issue.
> - But tune2fs report that last checked and mount time is Sun Dec 15,
> but this is incorrect.

The problem is casued by the fact that the mount time is incorrect,
which indicates that the system time was incorrect at the time when
the file system was mounted and when it fsck was run.  Since the last
write time was in the future, this triggered "time is insane" check.

This is inconsistent with your report that started happening when you
switched to a new motherboard.  That's because the real time clock is
not reporting the correct time when the system is booted.  Later on,
in the boot cycle, after the root file system is checked and remounted
read-write, the system time is getting set from an internet time
server.  This then causes the last write time to be ahead of the last
mount time, and "in the future" with respect to the real time clock.

Normally, the hardware clock's time gets set to match system time when
it is set from network time, or when the system is getting shut down
cleanly, but your init scripts aren't doing this properly --- or you
normally shut down your system by just flipping the power switch, and
not letting the shutdown sequence run correctly.  The other possibilty
is the real time clock on your system is just completly busted
(although normally when that happens, the last mount time would be in
the 1970's.)

Running "/sbin/hwclock -w" as root may fix things; as is figuring out
why this isn't run automatically by your boot scripts.  Another
workaround is to add to /etc/e2fsck.conf the following:

[options]
	broken_system_lock = true

This will disable e2fsck's time checks.

Cheers,

					- Ted

  parent reply	other threads:[~2020-01-01 14:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-01 10:58 [bugreport] Ext4 automatically checked at each boot Mikhail Gavrilov
2020-01-01 12:30 ` Mikhail Gavrilov
2020-01-01 14:17 ` Theodore Y. Ts'o [this message]
2020-01-01 23:19   ` Mikhail Gavrilov
2020-01-02  8:08     ` [bugreport] "hwclock -w" reset time instead of setting the right time Mikhail Gavrilov
2020-01-02 11:08       ` Karel Zak
2020-01-02 11:55         ` Mikhail Gavrilov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200101141748.GA191637@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mikhail.v.gavrilov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).