2

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?

Liam
  • 1,343
  • 3
  • 17
  • 28

1 Answers1

1

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.

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
  • No, maybe it cannot be controlled from Linux. – Liam Aug 14 '09 at 11:14
  • @liam: the noatime option will prevent Linux from updating the atime. whether the Windows server will update its equivalent to atime anyway is another story entirely. – cas Aug 14 '09 at 11:22
  • Is there a Windows equivalent to atime/noatime? – Liam Aug 14 '09 at 11:25