Bug 1365594

Summary: e2fsck.conf contains "broken_system_clock = 1" per default
Product: Red Hat Enterprise Linux 7 Reporter: Gabriele Pohl <contact>
Component: e2fsprogsAssignee: Lukáš Czerner <lczerner>
Status: CLOSED ERRATA QA Contact: Boyang Xue <bxue>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: esandeen, lczerner, pasteur, stuart, xzhou
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: e2fsprogs-1.42.9-13.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 11:38:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gabriele Pohl 2016-08-09 15:54:31 UTC
Description of problem:

In RHEL 7 the clock is assumed unreliable by default.
Automatic filesystem checks will then not work if triggered by interval setting.

To fix the error completely it is not sufficient to change the value to "broken_system_clock = 0" in e2fsck.conf. If root fs is ext4, then also the initramfs needs to be rebuilt after altering the e2fsck.conf value.

Version-Release number of selected component (if applicable):

e2fsprogs-1.42.9-7.el7.x86_64

How reproducible:

Install e2fsprogs. Have a look in /etc/e2fsck.conf

Steps to Reproduce:
1. Set auto fsck based on time interval (e.g. "tune2fs -i90 <device>")
2. Reboot on date after date shown in "Next check after:"
3. Filesystem will not be checked

Actual results:

Filesystem will not be checked automatically on time based setting.
Also no hint in boot messages what happened and how to fix it.

Expected results:

"broken_system_clock = 0" in /etc/e2fsck.conf

If you insist on declaring the system clock as unreliable by default,
there should at least be given helpful messages in boot.log

Additional info:

Issue was already addressed earlier:

https://bugzilla.redhat.com/show_bug.cgi?id=1105877
https://bugzilla.redhat.com/show_bug.cgi?id=963283

Comment 1 Eric Sandeen 2016-08-09 17:07:11 UTC
This got inherited from Fedora; at one point a wrong clock would completely break boot.

And in fact, as soon as I removed this config again in Fedora, I got boot failure complaints.

e2fsprogs has been through quite a few hacks to try to make time-based checks work while also not completely messing up the system if the clock is wrong; at this point I'd prefer to err on the side of reliable booting at the expense of time-based checks, especially because time-based fsck is turned off by default in RHEL7's mke2fs.

It probably would at least be worth documenting that if time-based checks are desired, e2fsck.conf must be updated and initramfs rebuilt.

Comment 3 Stuart D Gathman 2016-08-24 03:27:21 UTC
This also is causing problems for CentOS7 users:

https://bugs.centos.org/view.php?id=11352

Comment 4 Eric Sandeen 2018-03-29 18:57:22 UTC
The details of the situation and workaround is documented in

https://access.redhat.com/solutions/2766221

As of now, risking boot failures due to clock errors is simply not a reasonable tradeoff.  For those who desire time-based boot-time checks, the procedure for enabling them is described above.

Comment 6 Stuart D Gathman 2018-03-30 13:35:56 UTC
FWIW, I agree that the default should stay.  The only goal should be to avoid sysadmins spending too many hours trying to figure out why fsck refuses to check filesystems at boot.  Would it be worth it to add a message to the journal?  If e2fsck would just explain why it won't check the filesystem.

Comment 7 Eric Sandeen 2018-03-30 15:22:07 UTC
Something like:

Checking filesystems
Checking all file systems.
[/sbin/fsck.ext4 (1) -- /] fsck.ext4 -a /dev/mapper/vg_bp05-lv_root 
/dev/mapper/vg_bp05-lv_root: ignoring check interval, broken_system_clock set.

makes sense to me.  I'll send a patch.

Comment 17 errata-xmlrpc 2018-10-30 11:38:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3276