Important: Don’t do this if you use journaling file system.
I use both Centos 4 and 5. To enable automatic filesystem check after unclean reboot, do these commands (as root):
echo "AUTOFSCK_TIMEOUT=5" > /etc/sysconfig/autofsck
echo "AUTOFSCK_DEF_CHECK=yes" >> /etc/sysconfig/autofsck
According to this article, you won’t require it if you use ext3 (as in my case). You will lose some of your data if you do so.
Credits:
- http://lists.centos.org/pipermail/centos/2006-November/072253.html
- http://www.brunolinux.com/04-The_File_System/Auto_Fsck.html