Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-30-2009, 09:51 AM   #1
Senior Member
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
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.
Old 09-30-2009, 10:13 AM   #2
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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.
Old 09-30-2009, 10:14 AM   #3
Registered: Aug 2008
Location: Denmark
Distribution: Fedora, Ubuntu, Solaris
Posts: 35

Rep: Reputation: 19

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

touch /forcefsck
then reboot.

You can get some info running tune2fs:

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

Last checked:
Check interval:
Next check after:

Old 09-30-2009, 10:17 AM   #4
Registered: Jan 2006
Location: Chennai, Tamil nadu, India
Distribution: Debian Etch Testing
Posts: 117

Rep: Reputation: 16

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.
Old 09-30-2009, 10:34 AM   #5
Senior Member
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
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?
Old 09-30-2009, 11:36 AM   #6
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
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.
Old 09-30-2009, 11:47 AM   #7
Senior Member
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
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>)
Old 09-30-2009, 08:03 PM   #8
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,834

Rep: Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559
See the manual
Looking at the -c, -i switches, those (your) values mean auto fsck has been disabled.
However NB:
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you run tightvnc server on RHEL so that it matches your gui screen? daveb1040 Linux - Newbie 1 12-23-2006 02:50 PM
fs damage. e2fsck will not run to fix linux partition aya_rei Linux - Software 4 02-23-2005 09:55 AM
Automatically Restart Server?? flamesrock Linux - Software 4 08-07-2004 10:25 PM
schedule 'e2fsck' to run on startup, possible? BxBoy Linux - General 1 02-18-2004 01:15 PM
run e2fsck when system is running? mikeshn Linux - General 1 10-14-2003 12:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration