Existem 3 opções de montagem das quais você geralmente deve estar ciente ao lidar com atime
. Você está familiarizado com os dois primeiros, da página man do monte
trechos
atime Do not use noatime feature, then the inode access time is controlled
by kernel defaults. See also the description for strictatime and
relatime mount options.
noatime
Do not update inode access times on this filesystem (e.g., for
faster access on the news spool to speed up news servers).
A outra opção com a qual você provavelmente não está familiarizado, e a que está causando seu luto é essa, que foi o padrão desde o kernel 2.6.30 :
relatime
Update inode access times relative to modify or change time.
Access time is only updated if the previous access time was
earlier than the current modify or change time. (Similar to
noatime, but doesn't break mutt or other applications that need to
know if a file has been read since the last time it was
modified.)
Since Linux 2.6.30, the kernel defaults to the behavior provided
by this option (unless noatime was specified), and the
strictatime option is required to obtain traditional semantics. In
addition, since Linux 2.6.30, the file's last access time is
always updated if it is more than 1 day old.
Você pode verificar se essas opções estão definidas em um sistema de arquivos, procurando em /proc/mounts
.
Exemplo
$ cat /proc/mounts | head -5
rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3976812k,nr_inodes=994203,mode=755 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
A diferença com relatime
vs. noatime
é que ele fará alterações, mas somente quando o tempo de acesso atual for posterior ao tempo de acesso anterior.
Access time is only updated if the previous access time was earlier than the
current modify or change time. (Similar to noatime, but doesn't break mutt or other applications that need to know if a file has been read since the last time it was modified.)