Forced FSCK on Bad Reboot

James Wilkinson fedora at westexe.demon.co.uk
Thu Jul 14 16:49:32 UTC 2005


Tony Nelson wrote:
> [Linux no longer does an extended check after power outage boot]
> 
> You could always switch back to Ext2 if you want long checks.  This is
> probably not a good idea.

Mike McCarty wrote:
> Why is this not a good idea? Not that I want to change anything.

OK: this doesn't look like it's been answered.

The problem is that when a computer powers off (or reboots)
unexpectedly, data in memory is lost, and the operating system "forgets"
what it was doing.

With ext2, Linux has to take an extended check of the whole filesystem
to make sure that everything was left in the right place (or at least,
in a consistent place). It can't always work out exactly which file and
which filename(s) go together (this is one reason for the lost+found
directory in each filesystem).

Ext3 is a "journalling" filesystem (as are Reiser, xfs, jfs, and NTFS).
Linux keeps a journal on disk of what it's doing, and makes sure that
the journal reaches disk before it makes any changes to the filesystem
structure on disk.

So when Linux powers up after an unexpected shutdown, it can simply read
the journal, find out what it was trying to do, and either "roll back"
the changes or complete them. It *knows* which parts of the filesystem
to look at, and how to fix them. So this is a much faster operation,
taking hundredths of a second.

> Hmm. Yet the boot has an option to do an extended check. If the extended
> check doesn't do any aditional useful work, then why is it an option?

In theory, ext3 should never get corrupted. But this theory doesn't
account for certain factors:

All Software Sucks. All Hardware Sucks. Most computers don't have ECC
RAM, and are going to get the occasional memory error. Hard drives and
processors (and cables) aren't perfect. There are always software bugs
to worry about. And someone has to worry about overclocking, or
heatsinks and fans falling off processors (we had *that* one at work
just today).

Given all that, it's a Good Idea to have some way of detecting and
correcting corruption in a filesystem.

James.

-- 
E-mail address: james | ...a probably apocryphal bilingual sign in darkest
@westexe.demon.co.uk  | North Wales. In English it says "70mph" and in Welsh
                      | "slow down, sharp bend ahead".
                      |     -- Peter Corlett




More information about the users mailing list