LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Filesystem check (https://www.linuxquestions.org/questions/linux-newbie-8/filesystem-check-787253/)

lrt 02-05-2010 10:23 AM

Filesystem check
 
you can refer to this ubuntu thread for context, but i'll sum up what i'm trying to do here to spare the reading. basically i want to be able to schedule a filesystem check with automatic repairs at the next boot time. i know i can run:

Code:

>/forcefsck
reboot

but i'm not sure if this will try to automatically fix errors which is what i want to do. the reason i want to do this is because i experienced a power outage (the machine was not plugged into an UPS) and i want to make sure everything is ok.

what should i do?

tredegar 02-05-2010 11:23 AM

Quote:

but i'm not sure if this will try to automatically fix errors
It will do, if this is possible.

In the above post, your syntax is wrong. It should be (as root)
Code:

touch /forcefsck
reboot

shutdown -rF now used to be the command to Force a fsck at the next boot, but for some reason the -F flag has been removed from shutdown's options.

jschiwal 02-05-2010 12:09 PM

You could change the value for the number of times between checks with tune2fs's -c <count> option, or use the -t option for a time based value. You could use -d1 for daily checks. I'm not certain whether -c1 will run fsck every time or every other time.

The manpages suggests staggering the mount counts to avoid each filesystem being mounted at once which presumes a larger -c<count> value.


All times are GMT -5. The time now is 05:31 PM.