Skip to main content
Welcome guest. | Register | Login | Post

too many filesystem checks?

If you often switch your Linux computer with ext2 or ext3 filesystem on and off (for example because it is a laptop), it will check the filesystems at boot more often than necessary. Having to wait at unexpected times is annoying, and when this happens every few days and always just when you needed access to your data quickly, even more so.

Having a fixed time interval between these checks (so you know when they will happen) instead of checks happening when a counter reaches some number is much better. Configuring this is quite easy. First, look in /etc/fstab . In my case, the relevant lines are:

/dev/sda1 /boot ext2 defaults 0 1
/dev/sda3 / ext3 noatime 0 1
/dev/sda4 /home ext3 noatime 0 1

Now we know which device contains which always-mounted filesystem. To set the checks to be monthly, I run these commands:

tune2fs -c 0 -i 1m /dev/sda1
tune2fs -c 0 -i 1m /dev/sda3
tune2fs -c 0 -i 1m /dev/sda4

-c 0 means no mount counter will be used. If you would want a check at every 100th boot, you would use -c 100.

-i 1m means the filesystem will be checked every 1 month. Other examples of what could be used in combination with -i are 2d (2 days) or 3w (3 weeks).

Comments

Great tip! In Ubuntu it's

Great tip! In Ubuntu it's set to a certain number of boots if I remember right, and it didn't bother me much, but if it starts to, I'm gonna set it to one month..

Btw, is there a configuration file somewhere which stores these values?

Thanks

AFAIK there is no such

AFAIK there is no such configuration file for such settings, they are stored in a data structure that is invisible to regular programs. When a filesystem is to be checked could in principle be written in a file in that same filesystem, but it's not a very good idea: what if this file is deleted by mistake or incorrectly formatted information is written to it? Check the filesystem because a problem with the configuration file could mean data corruption? Don't check at all? Revert to some default behavior? Refuse to boot?

If you look at the man pages of tune2fs and mke2fs, you'll see lots of options that could cause even more odd chicken-and-egg situations if they were configured through a file.

finally

 

I'm using ubuntu on my laptop and it sometimes gets annoying, but I always forget to look it up on how to stop it from checking, and finally I find it here while I'm not looking Laughing out loud
thanks
by the way, I read that the "noatime" option speed up accessing the hard disk for not writing the time every individual file was accessed.. is that true ? in other words.. is it worthy to add this option ?

Does noatime work? Yes, but

Does noatime work? Yes, but whether or not it will work so much that it will be noticable depends on how you use your computer. Especially tasks in which many files are read should be noticably faster (for example starting gimp).

I use the noatime optimization. It's harmless (except MAYBE not if you use the mutt email program), so why not? I didn't run any tests, and I tweak my system to be both faster and less power hungry all the time, so I couldn't say with confidence if my speed gains were from noatime or something else.

If you're interested in improving desktop performance, you will probably like this article

nice article, I think I

 

nice article, I think I have a collection of tweaks now for both my desktop and laptop Laughing out loud
thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.