LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Running fsck at bootup (https://www.linuxquestions.org/questions/slackware-14/running-fsck-at-bootup-478777/)

swampdog2002 08-30-2006 09:19 AM

Running fsck at bootup
 
Hello,

I would like to know how to enable the fsck utility to run at bootup during regular intervals specified, such as every other day. I realize that this has to be performed before the filesystem to run fsck is mounted, and would like to know where the script or command should be placed to run before the drive is mounted in r/w state. I have seen this done using a 2.4x kernel in Slackware whenever a forced shutdown of the system had been performed, and fsck ran during the next bootup to check for inconsistencies with the filesystem. Any assistance is greatly appreciated. Thanks.

drkstr 08-30-2006 09:44 AM

File system check is done in the /etc/rc.d/rc.S. Look for the comment that says

# Check the root filesystem:

and start there. Let me know if you still need help with this.

regards,
...drkstr

cereal83 08-30-2006 03:09 PM

You could change the settings if using ext3 to check after 5 reboots or every 7 days if you wanted to.

Woodsman 08-30-2006 03:22 PM

To continue drkstr's advice, you could add touch /etc/forcefsck to /etc/rc.d/rc.local. This would automatically create the /etc/forcefsck file, which /etc/rc.d/rc.S looks for to perform a forced file check upon the next boot-up. If you wanted the file system check only every other day, you could add some additional scripting instructions in rc.local to create /etc/forcefsck based upon the day of the week.

swampdog2002 08-30-2006 05:55 PM

Thanks for the replies to my question. If I wanted to run fsck while logged in to the console, what methods would I take to mount the root drive (in this case, /dev/hda2) in a read-only state in order to check the drive? I have seen a few different methods pertaining to this with other distributions, but not Slackware-specific. Also, I don't want to end up wreaking havoc when performing this procedure, so any help is appreciated. Thanks.

drkstr 08-30-2006 08:34 PM

type 'man mount' then look for the option ( -o ) that says "remount" and the other option that says read-only.

Let me know if you still need further help with this.

regards,
...drkstr


All times are GMT -5. The time now is 08:30 PM.