67

Having every file be updated just when accessing them sounds like a waste.

What's the catch with mounting a file system with the noatime option. What kind of applications/servers relies on the access time?

4 Answers 4

50

Consider relatime:

If you have a newish install (~2008), you can use the relatime mount option. This is a good compromise for atime I think. From the kerneltrap discussion about implementing this new option:

"relative atime only updates the atime if the previous atime is older than the mtime or ctime. Like noatime, but useful for applications like mutt that need to know when a file has been read since it was last modified."

This makes it so most of the applications that need atime will still work, but lessens the disk load -- so it is a compromise. This is the default with recent Ubuntu desktop distributions.

Regarding noatime and nodiratime:

If you are going noatime for files, I wonder if there is a reason not to use nodiratime in addition to noatime so you are not updating the access time on directories as well.

The other reason to keep atime enabled which wasn't mentioned is for auditing purposes. But since who accessed it is not kept and only when, it is probably not that useful for an audit trail.

All of these options can be found in 'man mount 8'.

3
  • 1
    +1 relatime has the advantages of noatime and none of the disadvantages. Jul 29, 2009 at 11:49
  • 11
    Reading some more about this, it seems noatime also includes nodiratime (it didn't , many many years ago though)
    – nos
    Jul 29, 2009 at 23:59
  • Note, since Linux 2.6.30 relatime is the default. But in addition the file's last access time is always updated if it is more than 1 day old. This means that a daily backup process or searching in large maildirs may still have unnecessary high I/O impact.
    – rudimeier
    May 18, 2017 at 5:37
19

There exist applications that will move files off to a secondary storage if they haven't been accessed for a certain time period. Obviously, they need the atime.

Other than that, I don't see much use for this (anymore), especially as file managers these days have a tendency to open files to generate previews, therefore modifiying the atime just while browsing a directory.

I always mount with noatime these days.

16

There are very little there are some applications that rely on this for example Mutt cannot determine if the folder has received new mail since last visited.

Generally I and others think that mounting noatime is a good idea.

3
  • 3
    Even then, it only applies to mbox stores. Some might say that you get what you deserve.
    – Dan Carley
    Jul 29, 2009 at 11:06
  • Don't use noatime; use relatime instead. See Kyle's answer. Jul 29, 2009 at 11:50
  • Note that relatime is a relatively new addition to the options. If you have an older kernel (i.e. if you still have any Debian/Sarge based machines running) you might not have it. Jul 29, 2009 at 12:43
13

the main disadvantage that hasn't been mentioned yet is that if you have a tmpreaper process (i.e. a program that deletes files in /tmp that haven't been accessed for a while), it could delete tmp files that are still in use.

relatime is a better option than noatime. it only updates atime if the file has been modified since the last atime update. this has obvious benefits for mail clients. it still doesn't fix the tmpreaper issue (a file may be read from /tmp for ages without being written to).

overall, the disadvantages are minor (non-existant except for a few special cases), and the performance benefit is significant.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .