Linux has a special mount option for file systems callednoatime that can be added to each line that addresses one file system in the/etc/fstab file. If a file system has been mounted with this option, reading accesses to the file system will no longer result in an update to the atime information associated with the file like we have explained above. The importance of the noatime setting is that it eliminates the need by the system to make writes to the file system for files which are simply being read. Since writes can be somewhat expensive, this can result in measurable performance gains. Note that the write time information to a file will continue to be updated anytime the file is written to.
Linux对于文件系统有一个特殊的挂载选项noatime,可以添加到一个文件系统的/etc/fstab文件中的每一行中。如果文件系统已经有了这个选项,阅读的文件系统的访问将不再更新文件的atime相关信息。使用noatime设置的重要性是它消除了简单地被读出的文件的atime的更新。因为系统运行的时候要访问大量文件,如果能减少一些动作(如减少时间戳的记录次数等)将会显著提高磁盘 IO 的效率、提升文件系统的性能。
# vim /etc/fstab
UUID=b9991053-7d51-4f84-8760-b570fd499517 / ext4 defaults,noatime 1 1
保存即可,下次开机启动时就不会再启用atime了
atime Do not use noatime feature, then the inode access time is controlled by kernel defaults.
See also the description for strictatime and reatime 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).
注:RHEL6版本默认已经不再启用atime了