linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: "Andreas Dilger" <adilger@dilger.ca>,
	"Eric Sandeen" <sandeen@redhat.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"Lukáš Czerner" <lczerner@redhat.com>
Subject: Re: [PATCH] tune2fs: remove dire warning about check intervals
Date: Wed, 19 Jul 2017 10:57:05 -0700	[thread overview]
Message-ID: <20170719175705.GB4211@magnolia> (raw)
In-Reply-To: <20170719011517.tfvnzb7mzfle25hi@thunk.org>

On Tue, Jul 18, 2017 at 09:15:17PM -0400, Theodore Ts'o wrote:
> On Tue, Jul 18, 2017 at 04:28:16PM -0600, Andreas Dilger wrote:
> > 
> > Sigh, I still think this is going in the wrong direction.  I'm happily
> > running a weekly e2fsck on a snapshot of the filesystem, and then reset
> > the time and mount-count fields in the superblock with tune2fs.  That
> > way I never see any warnings, or have slow boots because of a scan, but
> > I'm also notified if there are ever problems on the filesystem (which
> > happens occasionally, since I'm sometimes running experimental code).
> > 
> > Since virtually everyone is using MD/LVM devices these days, I don't
> > think that is hard to do.  I offered up my "lvcheck" script a few times,
> > but nobody at RH or on the DM team seemed interested at the time...
> > I'd also be happy if there was some other similar mechanism included with
> > the distro to do periodic background checks of the filesystem, rather
> > than letting them find any problem at some random time.  This is pretty
> > standard for RAID systems, I think it makes sense for the filesystem too.
> 
> I've had e2croncheck in the contrib directory for a long time.  I
> suspect it wouldn't be that hard to make a version of it which scans
> /proc/mounts, and for those devices that are in an LVM, or dm-thin,
> and if there is room for a snapshot, it would create a snapshot, run
> fsck on the snapshot, and if there are any errors, sends an e-mail
> report to root by default.  (We would need to have some kind of
> configuration file in /etc to control where to send the reports, what
> the default snapshot size should be, etc., but if we have intelligent
> defaults than the config file could be optional.)
> 
> We could try to make it a bit nicer, and then move it to the misc
> directory and start installing it by default with "make install".
> That might make it easier for more users to set it up.  Maybe some
> distros will even decide to install a crontab entry by default.

So... I've had a private debian package for years that does most of
this.  There are two scripts -- one that uses lvs and blkid to identify
potential ext4 LVS and calls the second script, which sets up the
snapshot, runs e2fsck on that, and (optionally) calls fstrim on the
original fs if the snapshot fscks cleanly.  There's also a udev rules
script to discourage udev from "managing" /dev/disk/ symlinks to the
fsck snapshot.  Newer versions of the package integrate systemd support
to (clumsily) isolate the e2fsck process, send email if things fail, and
run automatically a la cron.

There are some missing pieces, however -- I didn't modify d-i to reserve
free space in the VG; there needs to be a monitoring daemon to kill fsck
and the snapshot if the snapshot exhausts all of its space; a boot time
script to kill the fsck snapshots if the system happened to go down
while fsck was in progress.  It also assumes that the fs is idle enough
that 256M for the snapshot will be sufficient.

I've never bothered to submit any of it because I haven't had the time
to implement any of those missing bits.

--D

> 
> 	     	  	    	      - Ted

  parent reply	other threads:[~2017-07-19 17:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 21:10 [PATCH] tune2fs: remove dire warning about check intervals Eric Sandeen
2017-07-18 22:28 ` Andreas Dilger
2017-07-19  1:15   ` Theodore Ts'o
2017-07-19  7:21     ` Lukas Czerner
2017-07-19 14:42       ` Theodore Ts'o
2017-07-20  8:57         ` Lukas Czerner
2017-07-19 17:57     ` Darrick J. Wong [this message]
2017-07-19  2:06   ` Eric Sandeen
2017-07-19  7:25 ` Lukas Czerner
2017-07-19 17:26 ` [PATCH V2] tune2fs: edit " Eric Sandeen
2017-07-19 17:29   ` Andreas Dilger
2017-07-23 22:36   ` [V2] " Theodore Ts'o

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=20170719175705.GB4211@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=adilger@dilger.ca \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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).