Timothy Bolz wrote,
>I found that you can have linux fsck every time if you want. Read the man page
>for fstab. You would just edit the fstab file the fifth and sixth field. Each
>time it reboots it would fsck. You can always change them back. I believe it
>was Neil who told me about this a while back. It sounds like a non zero forces
>a fsck. You could have it check each partition. Neil can possibly inform us a
>little more about this. I hope this help.
Well...yes, but if I understand the question correctly, this isn't exactly
what was wanted.
Setting the last column in /etc/fstab to a non-zero number forces that
filesystem to be fscked at boot. First all the things labelled "1" get
checked, and then all the things labelled "2", and so forth.
But it's quite likely that your /etc/fstab is *already* set up like this
(most distributions set it up automatically at install time).
And just because a filesystem is marked for fscking in /etc/fstab doesn't
mean it will actually get fscked. Ext2fs, for example, maintains an
"unmounted cleanly" flag in the superblock of the partition. If fsck
discovers that this flag is set, it skips the check and moves on to the
next filesystem.
So on most boots, here's what happens:
If the /etc/fstab flag is 0, the check is skipped.
If the /etc/fstab flag is not 0, fsck looks at the "clean unmount"
flag, sees that it's set, and the check is skipped.
So if you want to force a real check, just setting the /etc/fstab flag
isn't enough. Ext2fs counts the number of "mount" commands since the last
real fsck, and if this count passes a certain limit (20 by default), the
"clean unmount" flag is ignored and a real check is forced. Several people
have suggested "tune2fs" commands that do the trick by increasing the mount
count past the limit, or lowering the limit.
Of course it's always possible to force a real fsck by shutting down the
system improperly, but that's asking for trouble, and definitely not
recommended.
- Neil Parker, [EMAIL PROTECTED]