11

What is the difference between nointegrity, noatime and relatime? And what is the best option for a SSD? I am using ext4 as my filesystem. And why disabling journaling on my system, data loss can occur? Can I use for example nointergrity & noatime together in fstab, or only one option is accepted? Thank you!

Daniel
  • 307
  • 1
  • 2
  • 10

1 Answers1

9

The nointegrity option has no direct relation with atime, noatime, relatime or nodirtime. You could choose only one of the time options for files. Using noatime imply nodirtime. So, noatime will make all files and directories noatime.

In my system I can not find the option nointegrity for ext4. Please check the man mount in the section for ext4 to find available options for it. The only options ext4 allows for journaling are journal, ordered and writeback. If you don't want possible filesystem corruption on a crash, do not use writeback.

So, for an SSD, make sure the discard option is enabled (it is by default). It will probably be safer to use relatime. The noatime may be infinitesimally faster but there is some risk of some programs failing to work correctly.

In ext4 there is no nointegrity option, but, in any case, do not use it if you care about having reliable data (you have been warned!).

  • https://wiki.archlinux.org/index.php/Improving_performance#Disabling_journaling_on_the_filesystem I understood that I should not disable journaling so data loss doesn't occur. But why relatime is safer than noatime? – Daniel Jun 18 '17 at 16:54
  • @Dankata Safer: not with your data but with the ability to run some programs that need an ordered (in time) list of files –  Jun 18 '17 at 17:50
  • So if I mount my drive with noatime, data loss cannot occur, just some programs might not work? – Daniel Jun 19 '17 at 14:16
  • @Dankata Yes, no data loss should occur in the data written to the disk. However, if the application that use the data fails due to the times being out of sync, the data such application will write to the disk could be incorrect and some data loss (of that application) may still occur. This is mainly an issue for mail servers IIRC. –  Jun 19 '17 at 16:18
  • @Dankata More detail here: [Some applications, like tmpwatch, some backup programs, and some things having to do with email (mutt, pine, sendmail, etc.) care about atime.](https://lonesysadmin.net/2013/12/08/gain-30-linux-disk-performance-noatime-nodiratime-relatime/) –  Jun 19 '17 at 16:48
  • 1
    OK, so you don’t know what `nointegrity` means/does.  Do you know the difference between `noatime` and `relatime`? – Scott - Слава Україні Mar 07 '18 at 23:34
  • `nointegrity` disables journaling, which basically disables crash safety. `noatime` disables access (read) time which generates a ton of writes, but is only used by a few programs like auditing, backup, or file monitors. `relatime` updates atime whenever atime < mtime, which reduces most of the writes while avoiding most of the bugs associated with noatime. Relatime is now the default with newer kernels (2.6.30 or later). – Alcamtar Aug 04 '23 at 23:20
  • Worth adding that `discard` is not recommended as a mount option any more. Instead enable periodic (weekly) TRIM using `systemctl enable fstrim.timer`. – Alcamtar Aug 04 '23 at 23:22