Question about fstab : is the noatime option safe to use?
Trying to automount on startup my second internal hdd and while I was reading the arch wiki about available options, I stumbled upon this part : "The use of noatime, nodiratime or relatime can help disk performance for ext2, ext3, and ext4 filesystems. Linux by default keeps a record (writes to the disk) every times it reads from the disk atime. This was more purposeful when Linux was being used for servers; it doesn't have much value for desktop use. The worst thing about the default atime option is that even reading a file from the page cache (reading from memory instead of the disk) will still result in a disk write! Using the noatime option fully disables writing file access times to the disk every time you read a file. This works well for almost all applications, except for a rare few like Mutt that need the such information."
I checked my fstab and saw that this is not on by default so I was wondering whether I could enable it for my root, home and the 2nd internal drive partition without any side effects. Is that considered safe practice?
PS : I managed to mount my second internal drive by using the options defaults,user. Up to now, what I had to do was go to nautilus and enter my root password in order to mount the drive. Are the options I put in the fstab correct? I read somethings about noexec, nouid which are implied in the defaults option, but I dont really know what they mean, and I also read that the user option overrides them. Basically what I want to ask is whether I get the same functionality now with the one I had before by mounting the drive with the root password or do I miss something?
About this post
- Posted
- Archived
- Score
- 15 · 100% up
- Kind
- Text
- ID
- mtbr5
17 comments
I have the noatime option on all my filesystems for about one and half years now. Never gave me trouble.
Aren't they programs relying on atime ? I remember myself writing a script for cleaning unused files using it...
There were actually a few programs using atime (e.g. mutt), and over a couple of years most applications have also moved away because they could not be sure that the target machine was not running with noatime option. I'll let Ingo Molnar explain the problem better than I can.
For those applications which do use atime (like mutt and your script) there's also the relatime option which keeps a usable access time but reduces the number of disk writes drastically.
More than likely adding in noatime and nodiratime as mount options should be safe, and will definitely provide an improvement if you are reading a lot of files off of your H.D.
There are some programs that do depend on atime, but I haven't run across any.
Gentoo also used to recommend the notail (reiserfs specific) mount option for increased H.D. performance.
noatime implies nodiratime. You only need the first one.
Sweet! I never knew that. Thanks for the enlightenment! :)
hmm maybe notail was what I was thinking of.
yes. i've always used it for flash-memory based installs when i don't specifically need it.
there are a lot of things that are not set up by default that are perfectly safe to do.
noatime is considered not safe, but it only affects specific cases outside of normal use, ymmv. Many reports no trouble with noatime and only a few experienced unexpected trouble and had to switch back.
If you want to stay on the safe side use relatime, a little lower performance gain but safe.
IIRC gentoo used to suggest the noatime option on reiserfs partitions and thats what i was using at the time so i enabled it and never had anything bad happen to me at least related to that. Honestly I doubt you would notice much difference.
I mount /home as noatime,nodiratime since I do most of my building in my homedir. It helps speed up builds when it doesn't have to write back each time it reads a file.
For ext4 i keep defaults. For ntfs-3g and all external/usb drives i use noatime,nodiratime
I've been using it on my primary disks on two machines for a few years now. I don't have benchmarks to back it up, but it doesn't add anything for me so I figure why not turn it off. I've never seen an ill side-effect.
atime is just a filesystem attribute that records when a file was last accessed.(as opposed to time last modified, which more people are aware of) This turns it off, so unless you have a reason to know when files were last accessed(which can be useful in many situations, but most people don't check), go ahead. I would personally keep it on unless I felt like I was having performance problems, especially on network filesystems and the like.
Have a glance through this.
Having the user option means that any user can mount the filesystem - the default is that only root can mount filesystems.
Also from the same link:
which means specifying user implies the options one way, but if you explicitly add the options the other way, they'll still work.
I think only programs like mutt care about atime. If you use mutt use relatime.
https://www.kernel.org/doc/Documentation/filesystems/ext4.txt
there ya go, best info available on the ext4 mount options.