Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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?
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:
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.)
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.
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.
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.