Sponsored Links

Maxabout.com > Tips

Auto Fsck

Added on:9/3/2008 11:01:37 PM
In Linux Tips
 Rated by 1 users

You probably know already that every 20 to 30 times you reboot your system, or after each un-clean shutdown, you will get a check of the integrity of your file system.
NOTE: this text is only relevant for Ext2 filesystems . . . for Ext3 see "IMPORTANT" at the bottom of this tip.
Also you might have seen on the screen as the system files are checked that you have to hit the Y button within 5 seconds . . . . now, 5 seconds is very short and the chances are you will be just too late . . . the system will continue booting, but if there are problems with the integrity . . . you have a problem . . so most of the time at a file check I had my finger close to the Y button . . not anymore !
I did a few little tweaks:
Open the file ¨/etc/sysconfig/autofsck¨ in vi:
CODE
$ su
< password >
# vi /etc/sysconfig/autofsck
"i" ( to put vi in insert mode )
And you will see two lines:
AUTOFSCK_TIMEOUT=5
( just change the number of seconds here )
and
AUTOFSCK_DEF_CHECK=no
( change the value to yes and it will hit the Y for you )
Save the file
Esc ( put vi in command mode )
ZZ
If there is no such file as ¨/etc/sysconfig/autofsck¨, just make it ( They are the same commands to make or open a file in vi )
Mine looks like this:
# -*- Mode: sh -*-
# $Id:$
# Specify here how many seconds we wait for timeout
AUTOFSCK_TIMEOUT=3
# Specify if we do automatic fsck.
AUTOFSCK_DEF_CHECK=yes
# Specify how many seconds we wait for mounting crypto.
AUTOFSCK_CRYPTO_TIMEOUT=25
The last line is only for if you have a crypto file system installed ( search google/linux if you want to know more about crypto file systems )
IMPORTANT:
The text above is only relevant if you use Ext2 filesystem !
In case of a hard-reset, init messages indicate the computer was not shut down cleanly, and a message appear :"Press Y within 5 seconds to force the file system check "Actually this is very misleading : if you do it with ext3, it does NOT use the journal and then you will experience system losses. Lots of newbies have reported that problem.


Sponsored Links
Tools
Bookmark/Discuss