A few more notes, after a msg by Marshall.
noatime completely disables atime updates. This can be useful for files where atime is irrelevant, like everything in /bin, /sbin, /lib, /usr/bin, /usr/sbin, /usr/lib. No one cares when /bin/bash was read last. On a desktop / server, where disks rotate continuously, the atime update does not matter, but on a laptop or on flash media, like CF- (DIY firewall) or SD-cards (Raspi), each atime update means a disk update / a write cycle. So mounting those directories, or perhaps the entire root fs with noatime makes sense there. /home, /tmp and /var (or at least parts of /var) would live on a different filesystem with different mount options. If set up cleverly, the root fs could also be mounted read-only, preventing all updates including atime.
strictatime is the classic unix behaviour. Update atime everytime a file is read.
relatime is a clever hack. The atime is updated, but only if the previous atime was earlier than the current mtime or ctime. This helps programs like mutt to detect that a file has been read since the last modification. Newer Linux versions (>= 2.6.30) also update atime if the difference is larger than one day. Default since 2.6.30.
Then, there is also lazytime. This updates atime, ctime, and mtime only in memory. For userspace, this should look like strictatime, but time changes require no disk access, so disks can be stopped, flash write cycles are prevented. Times are written to disk / flash only if something else changes in the inode, on fsync/syncfs/sync (e.g. from umount), when the (undeleted) inode is removed from memory, or more than 24 hours have been passed since the last write for the inode. Of course, if you need the atime/ctime/mtime in software, you don't want an unexpected power cycle or a crash, because all unwritten updates would be lost.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] [d/l] [select] |