I've mounted disk with explicit given value – atime:
mount -o mount -o atime /dev/disk1 /myDisk
then I've created a file by
touch file_A
after this operation stat output looks like that:
Access: 2013-08-30 11:38:48.141970758 +0200
Modify: 2013-08-30 11:38:48.141970758 +0200
Change: 2013-08-30 11:38:48.141970758 +0200
after cat /myDisk/file_A
stat output changes but only once:
Access: 2013-08-30 11:39:11.141970758 +0200
Modify: 2013-08-30 11:38:48.141970758 +0200
Change: 2013-08-30 11:38:48.141970758 +0200
and then doing cat multiple times doesn't change Access time value at all.
What's wrong with that? Where this behavior coming from? I would expect that access time will change after every single cat operation on this file.
Why it shows only the first access?
(Mounting disk with noatime option causes another behavior, any of cat's changes access time in stat. Still remains equal to modify and change)
Best Answer
Is it possible that you use the
relatime
option when mounting? It is supposed to be some middle way betweenatime
andnoatime
by not causing as much I/O asatime
but still not breaking tools that break withnoatime
.This is the description out of
man 8 mount
: