util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
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 20:48:48 +0100	[thread overview]
Message-ID: <20171230194848.7tmw6pu6af6yichy@pali> (raw)
In-Reply-To: <20171230132045.GA3366@thunk.org>

On Saturday 30 December 2017 08:20:45 Theodore Ts'o wrote:
> 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

Ok, thank you for explanation. In case for a new UDF fsck tool it would
also make sense then to not do full check at boot time if filesystem is
marked as clean.

-- 
Pali Rohár
pali.rohar@gmail.com

      reply	other threads:[~2017-12-30 19:48 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
2017-12-30 19:48         ` Pali Rohár [this message]

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=20171230194848.7tmw6pu6af6yichy@pali \
    --to=pali.rohar@gmail.com \
    --cc=kzak@redhat.com \
    --cc=rain@vojtechvladyka.cz \
    --cc=tytso@mit.edu \
    --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).