Automatic fsck

Phillip Susi psusi at cfl.rr.com
Tue Aug 19 16:27:42 UTC 2008


Matt Zimmerman wrote:
>> One thing that I have not seen in this discussion is the notion that
>> fsck might be modified to run incrementally.
> 
> That's an interesting idea, though I don't know enough about ext3 to comment
> on its feasibility.  Perhaps something to discuss with upstream?

Not possible since things that have already been checked and since 
modified effect the things that have not yet been checked.  Anyone 
remember scandisk in windows 95?  Sure, it could run on a mounted disk, 
if you weren't writing to it at all.  As soon as the disk was written to 
in any way, it had to start over.

>> I see with some alarm discussion about reducing the frequency of running
>> fsck. I'm running an ext3 laptop and I'm seeing quite regular
>> corruptions that require an fsck run to fix. (It may be related to a
>> particular kernel, but I've not yet got to the bottom of that.)
> 
> That is a very disconcerting (and atypical) problem.  The appearance of
> errors in fsck indicates a serious problem which should be investigated, not
> a normal condition of wear and tear.

Indeed.

>> Fundamentally, in my opinion, fsck is a housekeeping process that is
>> required on a regular basis to ensure the sane state of a file-system,
>> no matter which one you use, errors do happen, even if there are no bugs
>> (ha!), we're talking about tiny magnetic fields affecting the
>> information on a hard-drive - this problem is only going to get bigger
>> with increased storage density.
> 
> I don't think there's any disagreement on this point.  The issues are:

As you said above, the appearance of errors in fsck is NOT a normal wear 
and tear condition, so periodic fscks are NOT a housekeeping process.

Errors do not creep into filesystems unless something has gone 
drastically wrong -- like a bug in the kernel overwrote part of the disk 
with random garbage.  Hard disks are also remarkably reliable these days 
and their internal ECC will detect any errors in the media and either 
correct them, or return an error when you try to read that sector ( 
which will cause an emergency remount-ro and a fsck on next boot ).  You 
don't just get a few random bits flipping that you won't notice unless 
you run a fsck.

Reiserfs does not bother doing periodic checks and never seems to suffer 
for it.  I always disable them on ext3 partitions, and used to do so on 
ext2 partitions throughout the 90s.  Fsck still ran when it actually 
needed to -- after a clean unmount.  Just to be sure, I'd still run a 
manual fsck every once in a while, especially before a defrag, but it 
never found problems, and that was before journaling.

> 1) The frequency at which fsck runs is somewhat arbitrary for many users,
> depending on their usage pattern, and doesn't relate particularly well to
> their risk of encountering errors.
> 
> 2) The fsck runs themselves are very disruptive, blocking access to the
> computer when the user wants it.

I think both of these points are best addressed with a simple, non 
obnoxious prompt on shutdown to run a fsck before shutting down, and 
also giving the option to put it off until tomorrow, next week, or never 
ask me again.





More information about the Ubuntu-devel-discuss mailing list