3

mount -o remount,ro,noatime

As the title says - if the filesystem is actually read-only, does noatime have any affect?

gng
  • 31
  • 1
  • 2

4 Answers4

1

No, read only means read only, if you told it to not write to it it will not write access times to it.

For more information, see man fstab.

Tamara Wijsman
  • 57,083
  • 27
  • 185
  • 256
ktf
  • 2,347
  • 1
  • 13
  • 12
  • I see, if you do not mind me asking - source on that? – gng Oct 20 '11 at 11:19
  • My experience :-) No, really: `ro` means NO writes at all. Everything else may safely considered as bug. – ktf Oct 20 '11 at 11:23
  • I'm not sure about that. It might that VFS handles noatime somehow different. A little bit of google search shows lots of people using both at the same time, but I couldn't get any source about why doing it or not, neihter in the man pages. – Jens Erat Oct 20 '11 at 11:53
  • On my system the man page stated `ro` means "read-only" (*phew*, lucky me). Adding `noatime` to `ro` helps as much as finger-crossing: Will do no harm! – ktf Oct 20 '11 at 13:05
  • ext4 replays the journal even on readonly mounts. So a readonly mount will still write to the underlying block device. (whether it processes atime is another matter). – sourcejedi Oct 18 '17 at 16:51
1

Short answer: No.

If the filesystem is mounted read-only, then the kernel module should be sufficiently smart to not even think about writing atime entries for accessed files, because that would constitute a ... write, which is verboten by the read-only status.

killermist
  • 1,929
  • 1
  • 17
  • 33
0

Possibly. Depending on the filesystem.

Actually things here are much more interesting and odd than you might think.

...

Mounting your NFS filesystems with noatime will reduce the number of NFS requests you make to the server.

https://utcc.utoronto.ca/~cks/space/blog/linux/NFSReadonlyAtime

sourcejedi
  • 3,212
  • 2
  • 22
  • 33
0

As you didn't specify an os.

I know that on certain systems ro mounted filesystem will still update the atime, unless you specify the noatime option.

Ro only means the user cant write not that the fs can't write.

So better safe than sorry.

John Kearney
  • 101
  • 1