LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-30-2009, 09:51 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
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
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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
IW2B
Member
 
Registered: Aug 2008
Location: Denmark
Distribution: Fedora, Ubuntu, Solaris
Posts: 35

Rep: Reputation: 19
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
 
Old 09-30-2009, 10:17 AM   #4
tshrinivasan
Member
 
Registered: Jan 2006
Location: Chennai, Tamil nadu, India
Distribution: Debian Etch Testing
Posts: 117

Rep: Reputation: 16
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/
 
Old 09-30-2009, 10:34 AM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
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
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 297

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
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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.
 
  


Reply


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


All times are GMT -5. The time now is 11:59 AM.

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