From: Theodore Ts'o <tytso@mit.edu>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: "Karel Zak" <kzak@redhat.com>,
util-linux@vger.kernel.org,
"Vojtěch Vladyka" <rain@vojtechvladyka.cz>
Subject: Re: fsck command line API
Date: Sat, 30 Dec 2017 08:20:45 -0500 [thread overview]
Message-ID: <20171230132045.GA3366@thunk.org> (raw)
In-Reply-To: <20171230120352.s64unqtl4dwypxnl@pali>
On Sat, Dec 30, 2017 at 01:03:52PM +0100, Pali Rohár wrote:
>
> Hi! Thank you for detailed information. I have just one more question,
> what should filesystem specific fsck do if is started by -a or -p (or
> with -y) during boot and filesystem structures indicates that last time
> it was successfully (clean) unmounted? Should it scan whole disk and
> check all data (files/directories/structures) for consistency? Or should
> trust for "clean" state and stop? And if stop, how to tell that
> filesystem fsck to really scan whole disk? For example scanning 2TB disk
> is really time consuming, specially at boot time.
What e2fsck (fsck.extN) does is check to see if the file system has
the "errors/corruptions were detected by the kernel" bit set. If so,
it will do a full check. Otherwise, if time-based or mount-based
criteria is enabled, and exceeded, then e2fsck will do a full check.
Otherwise, it will stop.
The other thing e2fsck for ext4 file systems will do is to replay the
journal. This is useful because fsck will run fsck in parallel, while
mount -a mounts file systems serially. So running the journal in
parallel when you have multiple disk spindles can be a big win. This
may be less of a big deal these days since systemd will run mounts in
parallel.
As far as time-based or mount-based full checks (see tune2fs for
discussion on this topic), we don't enable this by default any more in
e2fsprogs. That's precisely because doing full check for 10 TB disk
takes and 60TB RAID arrays takes a long time. The idea of doing mount
based checks goes back to the BSD days, because disks and memory are
really crappy, and so checking to find problems before they become
catastrophic data loss events made sense. These days for big disks,
the cost/benefit ratio doesn't work out as well.
Also, if you have snapshot support in your file system, you can simply
create a snapshot, and run the fsck on the snapshot. An example of
how to do this can be found here:
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/contrib/e2croncheck
Cheers,
- Ted
next prev parent reply other threads:[~2017-12-30 13:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-27 10:14 fsck command line API Pali Rohár
2017-12-29 12:02 ` Karel Zak
2017-12-29 18:37 ` Theodore Ts'o
2017-12-30 12:03 ` Pali Rohár
2017-12-30 13:20 ` Theodore Ts'o [this message]
2017-12-30 19:48 ` Pali Rohár
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=20171230132045.GA3366@thunk.org \
--to=tytso@mit.edu \
--cc=kzak@redhat.com \
--cc=pali.rohar@gmail.com \
--cc=rain@vojtechvladyka.cz \
--cc=util-linux@vger.kernel.org \
/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).