LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to tell if e2fsck will automatically run when I restart RHEL server? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-tell-if-e2fsck-will-automatically-run-when-i-restart-rhel-server-758675/)

anon091 09-30-2009 08:51 AM

How to tell if e2fsck will automatically run when I restart RHEL server?
 
Is there a way to tell if e2fsck will automatically run when I restart a server? The way I understand it is if the system things a mount is dirty, it will run e2fsck on it upon reboot.
Is there a way to look in some file or something before I restart it to tell if that will happen or not?
I know on Windows servers you can look at a registry key to see if a chkdsk will run at reboot.

MS3FGX 09-30-2009 09:13 AM

The filesystem will only be marked dirty if the system doesn't shut down properly. So if the system is up and running normally, and you shut it down properly, there will be no need for it to check the filesystem.

But if you do a hard power off, or the system locks, then it will not be cleanly unmounted and the check will be preformed.

IW2B 09-30-2009 09:14 AM

Hi,

There is no need for it to run if the file system is cleanly unmounted. If you want to force it to run then:

Code:

touch /forcefsck
then reboot.

You can get some info running tune2fs:

Code:

tune2fs -l /dev/sdXX
Amongst other things there will be:

Last checked:
Check interval:
Next check after:

Ian

tshrinivasan 09-30-2009 09:17 AM

Hi,

fsck is used to check and optionally repair one or more Linux file systems. You don't have to create or alter/modify any file. All you need to do is just create empty file /forcefsck.

See here.

http://www.cyberciti.biz/faq/linux-f...boot-sequence/

anon091 09-30-2009 09:34 AM

so doesn't it also set itself to run if the journaling on ext3 filesystems gets hosed? I'm just overly paranoid i'm due for a long reboot because i have a server that's been running for a long time, and I know a drive recently failed then switched over to a hot spare causing errors in the messages log.

So are you saying if I do a tune2fs -l /dev/sdXX then it will tell me if its going to run when i reboot? do you know how it specifically words it, just so I know what I'm looking for?

fpmurphy 09-30-2009 10:36 AM

If the mount-count parameter is greater than max-mount-count parameter for a filesystem, the filesystem will be checked at the next reboot. Use tune2fs to see or adjust the current values for any filesystem.

An alternative method is to use the interval-between-checks parameter to specify the maximum time between filesystem checks.

man tune2fs for more information.

anon091 09-30-2009 10:47 AM

running the tune2fs on one of my servers, it says the Filesystem state is "clean", but then has the following. does that mean anything special when Maximum mount count is -1.

Filesystem created: Fri Dec 29 07:15:32 2006
Last mount time: Mon Feb 2 11:58:05 2009
Last write time: Mon Feb 2 11:58:05 2009
Mount count: 18
Maximum mount count: -1
Last checked: Fri Dec 29 07:15:32 2006
Check interval: 0 (<none>)

chrism01 09-30-2009 07:03 PM

See the manual http://linux.die.net/man/8/tune2fs
Looking at the -c, -i switches, those (your) values mean auto fsck has been disabled.
However NB:
Quote:

A filesystem error detected by the kernel will still force an fsck on the next reboot, but it may already be too late to prevent data loss at that point.


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