lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250429163148.GA3354408@mit.edu>
Date: Tue, 29 Apr 2025 12:31:48 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: John Zakrzewski <jozakrzewski@...rosoft.com>
Cc: "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
Subject: Re: Question about fsck for ext4

On Tue, Apr 29, 2025 at 01:25:35PM +0000, John Zakrzewski wrote:

> Hi! We are using the k8 utils opensource
> project(https://github.com/kubernetes/utils) and looking for your
> thoughts on an issue where fsck is being run on every remount and if
> this is necessary for journaling filesystems.  Eric Sandeen's
> comments
> here(https://github.com/kubernetes/utils/pull/132#issuecomment-605492335)
> indicate it is not but wanted to verify with you that his statements
> apply to ext4 as well.  Ultimately I am looking for reassurance to
> relax the need for fsck on mounts for ext4.  I look forward to
> hearing your thoughts and please don't hesitate to ask clarifying
> questions. Thank you!

Normally, when you run fsck.ext4 on a file system with journalling
enabled, all fsck.ext4 will do is replay the journal.  This is fast,
and the advantage of doing this by fsck as opposed to replaying the
journal at mount time is if you have multiple spindles (HDD's),
/sbin/fsck will run multiple /sbin/fsck.ext4 in parallel, while
/sbin/mount -a will run the mounts sequentially, leading to the
journals being replayed sequentially.

XFS doesn't have the capability of replaying the journal in userspace,
so this is an advantage of ext4 --- although XFS uses logical
journalling so usually the time to replay the journal is smaller than
ext4's physical journalling, so the disadvantage of replaying the
journal sequentially versus in parallel is not that big of a deal for
XFS.

The other advantage of running fsck on the file system is if the
kernel discovers a file system inconsistency, it will set a flag
indicating that fsck should do a full check.  If you skip running fsck
at boot, then this automatic correction happen.  Of course, this
shouldn't be an issue if you are 100% certain that there are no
hardware faults, and no kernel bugs.  :-)

However, if the file system is not marked as having inconsistencies,
then the time to replay the journal is in general only a few seconds
if you are using a HDD, and less than a second if you are using a SSD.
And if the journal has already been replayed, running fsck -p on a
file system is super fast (well under a second), so long as the file
system is error-free.

So I'm not sure it's worth it for you to "relax the need for running
fsck", because the time to run fsck is quite short.

Now, if you are seeing that the fsck time is non-trivial, you should
investigate why that is the case.  Because that is definitely not
normal.

						- Ted

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ