LinuxQuestions.org
Visit Jeremy's Blog.
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 03-10-2011, 04:50 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
why does an e2fsck restart itself?


Why does an e2fsck restart itself after a while, does it get to a certain number of errors than has to start over from the beginning? are there any tweaks or switches you can use to make it run more efficiently?
 
Old 03-10-2011, 04:07 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
Do you mean "Why does it run on some boots and not others?"

The answer is that ext2 and ext3 filesystems have a parameter set that e2fsck will run automatically after a certain number of mounts. This can be adjusted with the tune2fs command. From the man page for that command:

Quote:
-c max-mount-counts
Adjust the number of mounts after which the filesystem will be
checked by e2fsck(8). If max-mount-counts is 0 or -1, the num-
ber of times the filesystem is mounted will be disregarded by
e2fsck(8) and the kernel.

Staggering the mount-counts at which filesystems are forcibly
checked will avoid all filesystems being checked at one time
when using journaled filesystems.

You should strongly consider the consequences of disabling
mount-count-dependent checking entirely. Bad disk drives,
cables, memory, and kernel bugs could all corrupt a filesystem
without marking the filesystem dirty or in error. If you are
using journaling on your filesystem, your filesystem will never
be marked dirty, so it will not normally be checked. A filesys-
tem 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.
I don't know of anything that automatically runs e2fsck on systems other than that. (One could of course setup cron jobs to do that but I don't know of anyone that does.)
 
1 members found this post helpful.
Old 03-11-2011, 02:38 AM   #3
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Hi, thanks for replying. That wasn't what I meant. I meant how sometimes when you run e2fsck, it will be running, fix a bunch of stuff, then it starts itself over from the beginning, and keeps doing that until it completes.

Thanks for the tune2fs info, I'm sure that will be handy if others read this post.
 
Old 03-11-2011, 09:37 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
I've not seen e2fsck do what you mention on a single filesystem.

However, I'm wondering if what you're seeing is that e2fsck checks one filesystem then checks another then another until all are done? That is to say if when you reboot you're actually running e2fsck on multiple filesystems so the start/stop you are talking about may be for the different filesystems. If you do "df -h" on your system it will show you all the mounted filesystems.
 
Old 03-11-2011, 09:46 AM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
I dont think I'm explaining this well. Let me try again. say you do a shutdown -rF now, your server reboots, as its coming up it e2fsck's each volume one by one. what typically happens for me (I'm lucky like that) is that when it e2fsck's one of my many huge volumes, it'll only get 25-50% done, then fails and says it needs to be run manually, then it drops you to a prompt to type the root password to get into the recovery console (can't remember the real name but that's essentially what it is, single user nothing mounted). At that point is when I run an e2fsck -y /dev/whatever. As its going through, it will get to a certain point (not sure what, but would like to know) then it restarts the e2fsck on that same volume automatically.

That's the scenario I was talking about. I guess it really can't run more efficiently than that, but was just wondering why it has to restart.
 
  


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
Help with FS check with e2fsck itsakc Linux - Newbie 2 04-20-2010 06:17 AM
[SOLVED] How to tell if e2fsck will automatically run when I restart RHEL server? rjo98 Linux - Newbie 7 09-30-2009 08:03 PM
HELP: mke2fs done instead of e2fsck :-( tkmbe Linux - General 3 05-04-2008 10:48 AM
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 12:24 PM
e2fsck Eugney Slackware 2 06-03-2005 12:13 PM


All times are GMT -5. The time now is 11:01 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