2009-11-09 08:53:24

by Pavel Machek

[permalink] [raw]
Subject: periodic fsck was Re: [patch] ext2/3: document conditions when reliable operation is possible

On Wed 2009-08-26 14:02:48, Theodore Tso wrote:
> On Wed, Aug 26, 2009 at 06:43:24AM -0700, [email protected] wrote:
> >>>
> >>> as the ext3 authors have stated many times over the years, you still need
> >>> to run fsck periodicly anyway.
> >>
> >> Where is that documented?
> >
> > linux-kernel mailing list archives.
>
> Probably from some 6-8 years ago, in e-mail postings that I made. My
> argument has always been that PC-class hardware is crap, and it's a

Well, in SUSE11-or-so, distro stopped period fscks, silently :-(. I
believed that it was really bad idea at that point, but because I
could not find piece of documentation recommending them, I lost the
argument.
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


2009-11-09 14:07:14

by Theodore Ts'o

[permalink] [raw]
Subject: Re: periodic fsck was Re: [patch] ext2/3: document conditions when reliable operation is possible

On Mon, Nov 09, 2009 at 09:53:18AM +0100, Pavel Machek wrote:
>
> Well, in SUSE11-or-so, distro stopped period fscks, silently :-(. I
> believed that it was really bad idea at that point, but because I
> could not find piece of documentation recommending them, I lost the
> argument.

It's an engineering trade-off. If you have perfect memory that is
never has cosmic-ray hiccups, and hard drives that never write data to
the wrong place, etc. then you don't need periodic fsck's.

If you do have imperfect hardware, the question then is how imperfect
your hardware is, and how frequently it introduces errors. If you
check too frequently, though, users get upset, especially when it
happens at the most inconvenient time (when you're trying to recover
from unscheduled downtime by rebooting); if you check too infrequently
then it doesn't help you too much since too much data gets damaged
before fsck notices.

So these days, what I strongly recommend is that people use LVM
snapshots, and schedule weekly checks during some low usage period
(i.e., 3am on Saturdays), using something like the e2croncheck shell
script.

- Ted

2009-11-09 15:58:55

by Andreas Dilger

[permalink] [raw]
Subject: Re: periodic fsck was Re: [patch] ext2/3: document conditions when reliable operation is possible

On 2009-11-09, at 07:05, Theodore Tso wrote:
> So these days, what I strongly recommend is that people use LVM
> snapshots, and schedule weekly checks during some low usage period
> (i.e., 3am on Saturdays), using something like the e2croncheck shell
> script.


There was another script written to do this that handled the e2fsck,
reiserfsck
and xfs_check, detecting all volume groups automatically, along with
e.g.
validating that the snapshot volume doesn't exist before starting the
check
(which may indicate that the previous e2fsck is still running), and
not running while on AC power.

The last version was in the thread "forced fsck (again?)" dated
2008-01-28.
Would it be better to use that one? In that thread we discussed not
clobbering
the last checked time as e2croncheck does, so the admin can see how
long it
was since the filesystem was last checked.

Maybe it makes more sense to get the lvcheck script included into util-
linux-ng
or lvm2 packages, and have it added automatically to the cron.weekly
directory?
Then the distros could disable the at-boot checking safely, while
still being
able to detect corruption caused by cables/RAM/drives/software.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.