Linux Disable /var Access Time Updates ( noatime )

I‘ve configured and mounted /var for squid caching and other purposes under Linux. I’ve noticed that the Linux file system keeps records of when files are created, updated, and accessed. My /var is exclusively used for caching purpose and I do not want to waste disk I/O while updating last-time-read attribute during reads and writes to files. How do I disable access time updates for /var partition?

You can mount file systems with the noatime option. It will prevent inode access times from being updated. Please note that use noatime only when file update times are not critical. Backup client software also use file last update time to sync with backup server. However, the following type of servers may work without problem:
a] Squid caching file
b] News server
c] Web servers etc.

/etc/fstab File

Edit /etc/fstab file and update it as follows:

/dev/sdXY /mount-point ext3 defaults,noatime 1 2

OR

/dev/md1 /var ext3 defaults,noatime 1 2

OR just remount the same from command

mount LABEL=/var -o noatime,nouser,remount,rw

Where,

  • noatime – Do not update inode access times on this file system.

I’ve seen performance benefit of 5-15% with an average of 5% for file server workloads. This hack is only useful busy servers.

Recommend readings:

man 8 mount

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • Steven Nov 27, 2009 @ 13:20

    You can do the same on a directory level with the nodiratime option.

  • Martin Nov 29, 2009 @ 16:51

    For security reason you can add noexec,nosuid,nodev.

  • Kashif Dec 2, 2009 @ 20:22

    “…Linux file system keeps records of when files are created, updated, and accessed”

    Linux doesn’t keep record of create time, instead it is change time.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.