Paul really said everything there is to say technically. I'd just like
to share my personal best practices.
I only use journaled ext3, so I can quickly bring up my system again if
it crashed. I disabled maximal mount count and timespam, so I won't be
surprised by fsck at system boot. If my system is working without
problems I do an fsck run from time to time, if I don't need my computer
(lunch breaks come in handy) with a "touch /forcefsck;reboot", so I
don't have filesystem curruptions.
I have further hacked my init scripts to honour a string "fsck" on the
kernel command line, which will trigger a forced fsck (similar to
setting /forcefsck). This way if my system crashes, I can force an fsck
run when rebooting by altering the kernel command line with the grub
bootloader, and I don't have to mount the filesystem writable, set
/forcefsck and reboot (which I would have to do without my command line
hack).
My code in the init script looks like this:
# check filesystems
FSCK=`dmesg|grep "Kernel command line:"|grep fsck`
if [ -f /forcefsck -o "$FSCK" ]
then fsck -A -P -C -a -f /
if [ $? -eq 2 ]
then halt -d -f
fi
fi
--
---> Dirk Jagdmann ^ doj / cubic
----> http://cubic.org/~doj
-----> http://llg.cubic.org