Linux – How to use noatime with smbfs

linuxmountserver-message-blocksmbfswindows

I am using the mount command on a Linux server to access a Windows server using smbfs. Can I use noatime to prevent read operations (such as cp on Linux) from changing the last-accessed time on files on the Windows server?

If so how can I do this?

Best Answer

I think you should be able to. According to man mount, no atime falls under "FILESYSTEM INDEPENDENT MOUNT OPTIONS". Does the following work?

mount -t cifs \\server\share /mnt/smount -o username=DOMAIN\administrator,noatime

Update:

Looks like the above does not quite cut it. It maybe stops Linux VFS from updating but not windows. However, the above in combination with changing the Windows registry not to update the access time on NTFS might do the trick:

System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
Value Name: NtfsDisableLastAccessUpdate
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disable, 1 = enable)

This still might not effect shares though.