linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bugreport] Ext4 automatically checked at each boot
@ 2020-01-01 10:58 Mikhail Gavrilov
  2020-01-01 12:30 ` Mikhail Gavrilov
  2020-01-01 14:17 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 7+ messages in thread
From: Mikhail Gavrilov @ 2020-01-01 10:58 UTC (permalink / raw)
  To: linux-ext4, nux-kernel

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.

I don’t know where to look further so I ask here for help.


Here is tune2fs report: https://pastebin.com/PZPbAuHS

# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon Sep  9 19:36:53 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=b3e2e027-c39d-4266-871f-22d313ac419b /                       ext4
   defaults        1 1
UUID=E8A2-F389          /boot/efi               vfat
umask=0077,shortname=winnt 0 2
UUID=bf3e9504-8000-42a1-adb4-226658ec7a5d /home                   ext4
   defaults        1 2
UUID=f47f69e1-61f8-4024-960a-b3981d3b1d02 none                    swap
   defaults        0 0


--
Best Regards,
Mike Gavrilov.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bugreport] Ext4 automatically checked at each boot
  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
  1 sibling, 0 replies; 7+ messages in thread
From: Mikhail Gavrilov @ 2020-01-01 12:30 UTC (permalink / raw)
  To: linux-ext4, Linux List Kernel Mailing

Maybe important:
This start happens since I upgraded motherboard to "ROG Strix X570-I
Gaming" on my previous motherboard "ROG STRIX X470-I GAMING" the
values "last checked", "mount time",  "mount count" was correctly
updated and displayed. And auto-check not started each boot.

On Wed, 1 Jan 2020 at 15:58, Mikhail Gavrilov
<mikhail.v.gavrilov@gmail.com> 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.
>
> I don’t know where to look further so I ask here for help.
>
>
> Here is tune2fs report: https://pastebin.com/PZPbAuHS
>
> # cat /etc/fstab
>
> #
> # /etc/fstab
> # Created by anaconda on Mon Sep  9 19:36:53 2019
> #
> # Accessible filesystems, by reference, are maintained under '/dev/disk/'.
> # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
> #
> # After editing this file, run 'systemctl daemon-reload' to update systemd
> # units generated from this file.
> #
> UUID=b3e2e027-c39d-4266-871f-22d313ac419b /                       ext4
>    defaults        1 1
> UUID=E8A2-F389          /boot/efi               vfat
> umask=0077,shortname=winnt 0 2
> UUID=bf3e9504-8000-42a1-adb4-226658ec7a5d /home                   ext4
>    defaults        1 2
> UUID=f47f69e1-61f8-4024-960a-b3981d3b1d02 none                    swap
>    defaults        0 0
>
>
> --
> Best Regards,
> Mike Gavrilov.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bugreport] Ext4 automatically checked at each boot
  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
  2020-01-01 23:19   ` Mikhail Gavrilov
  1 sibling, 1 reply; 7+ messages in thread
From: Theodore Y. Ts'o @ 2020-01-01 14:17 UTC (permalink / raw)
  To: Mikhail Gavrilov; +Cc: linux-ext4

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bugreport] Ext4 automatically checked at each boot
  2020-01-01 14:17 ` Theodore Y. Ts'o
@ 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
  0 siblings, 1 reply; 7+ messages in thread
From: Mikhail Gavrilov @ 2020-01-01 23:19 UTC (permalink / raw)
  To: Theodore Y. Ts'o; +Cc: linux-ext4

On Wed, 1 Jan 2020 at 19:17, Theodore Y. Ts'o <tytso@mit.edu> wrote:
>
> 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.
>

Thank you very much for the tip, I would never have guessed that the
cause of this issue in hwclock.
I started to watch hwclock through the motherboard BIOS and found that
hwclock resets every time after booting Linux.
Demonstration: https://youtu.be/TBrLNFbBaPo
Apparently for this reason, "hwclock -w" did not help me, workaround
with "broken_system_clock = true" is working, but I would like to fix
the root of the cause.
Who can help with this?


--
Best Regards,
Mike Gavrilov.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bugreport] "hwclock -w" reset time instead of setting the right time
  2020-01-01 23:19   ` Mikhail Gavrilov
@ 2020-01-02  8:08     ` Mikhail Gavrilov
  2020-01-02 11:08       ` Karel Zak
  0 siblings, 1 reply; 7+ messages in thread
From: Mikhail Gavrilov @ 2020-01-02  8:08 UTC (permalink / raw)
  To: util-linux, Linux List Kernel Mailing; +Cc: linux-ext4

"hwclock -w" reset time instead of setting the right time on M/B "ROG
Strix X570-I Gaming"
Demonstration: https://youtu.be/QRB7ZLiEfrc
Some DE like GNOME has automatic time synchronization option and there
is a feeling that hardware time reset after each Linux boot.

--
Best Regards,
Mike Gavrilov.
On Thu, 2 Jan 2020 at 04:19, Mikhail Gavrilov
<mikhail.v.gavrilov@gmail.com> wrote:
>
> On Wed, 1 Jan 2020 at 19:17, Theodore Y. Ts'o <tytso@mit.edu> wrote:
> >
> > 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.
> >
>
> Thank you very much for the tip, I would never have guessed that the
> cause of this issue in hwclock.
> I started to watch hwclock through the motherboard BIOS and found that
> hwclock resets every time after booting Linux.
> Demonstration: https://youtu.be/TBrLNFbBaPo
> Apparently for this reason, "hwclock -w" did not help me, workaround
> with "broken_system_clock = true" is working, but I would like to fix
> the root of the cause.
> Who can help with this?
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bugreport] "hwclock -w" reset time instead of setting the right time
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Karel Zak @ 2020-01-02 11:08 UTC (permalink / raw)
  To: Mikhail Gavrilov; +Cc: util-linux, Linux List Kernel Mailing, linux-ext4

On Thu, Jan 02, 2020 at 01:08:41PM +0500, Mikhail Gavrilov wrote:
> "hwclock -w" reset time instead of setting the right time on M/B "ROG
> Strix X570-I Gaming"
> Demonstration: https://youtu.be/QRB7ZLiEfrc
> Some DE like GNOME has automatic time synchronization option and there
> is a feeling that hardware time reset after each Linux boot.

 Can you try "hwclock -w -v" to get more details?

 For example on my workstation:

        # ./hwclock -w -v
        hwclock from util-linux 2.35-rc1-20-63f8
        System Time: 1577963091.683987
        Trying to open: /dev/rtc0
        Using the rtc interface to the clock.
        Last drift adjustment done at 1531914946 seconds after 1969
        Last calibration done at 1531914946 seconds after 1969
        Hardware clock is on UTC time
        Assuming hardware clock is kept in UTC time.
        RTC type: 'rtc_cmos'
        Using delay: 0.500000 seconds
        missed it - 1577963091.684767 is too far past 1577963091.500000 (0.184767 > 0.001000)
        1577963092.500000 is close enough to 1577963092.500000 (0.000000 < 0.002000)
        Set RTC to 1577963092 (1577963091 + 1; refsystime = 1577963091.000000)
        Setting Hardware Clock to 11:04:52 = 1577963092 seconds since 1969
        ioctl(RTC_SET_TIME) was successful.
        Not adjusting drift factor because the --update-drift option was not used.
        New /etc/adjtime data:
        0.000000 1577963091 0.000000
        1577963091
        UTC


    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bugreport] "hwclock -w" reset time instead of setting the right time
  2020-01-02 11:08       ` Karel Zak
@ 2020-01-02 11:55         ` Mikhail Gavrilov
  0 siblings, 0 replies; 7+ messages in thread
From: Mikhail Gavrilov @ 2020-01-02 11:55 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, Linux List Kernel Mailing, linux-ext4

On Thu, 2 Jan 2020 at 16:08, Karel Zak <kzak@redhat.com> wrote:
>
>  Can you try "hwclock -w -v" to get more details?
>
>  For example on my workstation:
>
>         # ./hwclock -w -v
>         hwclock from util-linux 2.35-rc1-20-63f8
>         System Time: 1577963091.683987
>         Trying to open: /dev/rtc0
>         Using the rtc interface to the clock.
>         Last drift adjustment done at 1531914946 seconds after 1969
>         Last calibration done at 1531914946 seconds after 1969
>         Hardware clock is on UTC time
>         Assuming hardware clock is kept in UTC time.
>         RTC type: 'rtc_cmos'
>         Using delay: 0.500000 seconds
>         missed it - 1577963091.684767 is too far past 1577963091.500000 (0.184767 > 0.001000)
>         1577963092.500000 is close enough to 1577963092.500000 (0.000000 < 0.002000)
>         Set RTC to 1577963092 (1577963091 + 1; refsystime = 1577963091.000000)
>         Setting Hardware Clock to 11:04:52 = 1577963092 seconds since 1969
>         ioctl(RTC_SET_TIME) was successful.
>         Not adjusting drift factor because the --update-drift option was not used.
>         New /etc/adjtime data:
>         0.000000 1577963091 0.000000
>         1577963091
>         UTC
>

# hwclock -w -v
hwclock from util-linux 2.35-rc1-20-63f8
System Time: 1577964536.796672
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1577950892 seconds after 1969
Last calibration done at 1577950892 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
RTC type: 'rtc_cmos'
Using delay: 0.500000 seconds
missed it - 1577964536.797135 is too far past 1577964536.500000
(0.297135 > 0.001000)
1577964537.500000 is close enough to 1577964537.500000 (0.000000 < 0.002000)
Set RTC to 1577964537 (1577964536 + 1; refsystime = 1577964536.000000)
Setting Hardware Clock to 11:28:57 = 1577964537 seconds since 1969
ioctl(RTC_SET_TIME) was successful.
Not adjusting drift factor because the --update-drift option was not used.
New /etc/adjtime data:
0.000000 1577964536 0.000000
1577964536
UTC

Demonstration: https://youtu.be/Yx27IH2opEc

--
Best Regards,
Mike Gavrilov.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-02 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).