11

Would the remount command do it if I add the option in /etc/fstab?

Is this this a good idea?

3
  • 2
    Good idea? Not always. Prefer relatime where available. Jan 4, 2012 at 2:38
  • @IgnacioVazquez-Abrams Why? I've equally read people saying 'prefer noatime unless you use the approximately 1 program that thinks it needs [rel]atime'. I have no reason to care about access time, so I'm turning it off. Jun 12, 2016 at 19:52
  • For me it is always good idea to use noatime. I never needed the atime attribute value from any single file. I believe this attribute is one of the worst and useless things anyone ever added in Linux. Mar 31, 2022 at 12:22

3 Answers 3

7

Not anymore. -o remount,noatime was an effective method of disabling atime without a reboot.

I don't know that I'd say it's a good idea, but if you intend to turn atime off, I don't see what it would be a bad idea either if you have an old enough kernel. According to the man page for mount:

MS_REMOUNT

The following mountflags can be changed: MS_RDONLY, MS_SYNCHRONOUS, MS_MANDLOCK; before kernel 2.6.16, the following could also be changed: MS_NOATIME and MS_NODIRATIME; and, additionally, before kernel 2.4.10, the following could also be changed: MS_NOSUID, MS_NODEV, MS_NOEXEC.

3
  • Thanks for the input - would I be able to remount and add "relatime" or will that require a reboot?
    – ckliborn
    Feb 23, 2012 at 20:12
  • 1
    @ckliborn I believe you will have to reboot, but there is no harm in testing a remount just to see. Feb 23, 2012 at 20:16
  • 1
    I just tried it on several servers with 2.6.32 and it worked on all of them. No reboot needed.
    – Tobia
    Jul 4, 2014 at 9:23
10

Yes, it would work.
Or you can manually add it like:

mount -o remount,noatime /dev/sd0 /mnt
2
  • 5
    With many versions of mount you can omit either the device or the mount point (your choice) and it will lookup the other.
    – tylerl
    Jan 4, 2012 at 2:37
  • Who said anything about /mnt? OP wanted to remount their / fs. I sure hope this command would stop some theoretical naive copy-paste reader from remounting their root filesystem at /mnt and thus, presumably, killing their entire session. I'm not about to test that theory, though! Jun 12, 2016 at 19:55
8

Edit /etc/fstab and add the proper noatime entry to your / filesystem entry.

Remount the / filesystem with:

mount -o remount,noatime /

4
  • How can I verify that the noatime functionality is in place after the remount? Also do I need to worry about anything when remounting /?
    – ckliborn
    Jan 4, 2012 at 5:56
  • 5
    You can look at /proc/mounts to see the flags currently in effect. Jan 4, 2012 at 7:18
  • 2
    Type mount. It will show the mount parameters.
    – ewwhite
    Jan 4, 2012 at 9:38
  • 4
    @ckliborn you can also test it by yourself: 1. pick a file that is not being read or written by anybody, 2. check its atime with ls -lu and make sure it's some time in the past, 3. read it with cat or cksum, 4. check its atime again and it should not have changed.
    – Tobia
    Jul 4, 2014 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .