歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 開機去掉atime參數

開機去掉atime參數

日期:2017/2/27 15:59:46   编辑:Linux教程
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).
注:CentOS6版本默認已經不再啟用atime
Copyright © Linux教程網 All Rights Reserved