Default atime/relatime/noatime setting: Udisks2

AmigaOne X5000 platform specific issues related to Linux only.
Post Reply
Roland
Posts: 824
Joined: Tue May 02, 2017 7:23 am

Default atime/relatime/noatime setting: Udisks2

Post by Roland »

What is the default value used in 'our' Kernel 5.x versions for saving time stamps when reading files: atime, relatime or noatime? I know it can be changed in fstsab for individual partitions, but can it be changed systemwide? I'm going to test a SSD drive with amiga Linuxes, and would definitely like to use 'noatime' as default for the whole system! That would avoid needless writings to the disk.

Also: what is the correct way to partition a SSD drive for Linux, so that there would not be unnecessary writing on the disk?
Last edited by Roland on Sat Apr 10, 2021 8:57 pm, edited 2 times in total.
- Roland -
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Default atime/relatime/noatime setting in Kernel 5.x?

Post by xeno74 »

Hi Roland,

I haven't found any kernel config options for atime. If you have any hints, please let me know.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
Roland
Posts: 824
Joined: Tue May 02, 2017 7:23 am

Re: Default atime/relatime/noatime setting in Kernel 5.x?

Post by Roland »

xeno74 wrote: Fri Dec 18, 2020 3:32 pm I haven't found any kernel config options for atime. If you have any hints, please let me know.
How about the

Code: Select all

./fs/namespace.c
which was found here:

https://askubuntu.com/questions/59179/h ... ts-default
- Roland -
Roland
Posts: 824
Joined: Tue May 02, 2017 7:23 am

Re: Default atime/relatime/noatime setting: Udisks2

Post by Roland »

@xeno74

I found out that since v. 2.9.0 of Udisks2 it is possible to set filesystem spesific mount parameters in the file '/etc/udisks2/mount_options.conf'.
(http://storaged.org/doc/udisks2-api/lat ... tions.html).

But what is the version of Udisks2 in Fienix, MintPPC and Ubuntu 16.04.7 ? Due to Xmas holidays I cannot access my own X5000 for a while to check this...
Last edited by Roland on Sat Apr 10, 2021 8:56 pm, edited 1 time in total.
- Roland -
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Default atime/relatime/noatime setting in Kernel 5.x?

Post by xeno74 »

I will try to figure out the versions of Udisks2 after the merge window.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
Roland
Posts: 824
Joined: Tue May 02, 2017 7:23 am

Re: Default atime/relatime/noatime setting: Udisks2

Post by Roland »

Roland wrote: Sat Dec 19, 2020 11:11 am @xeno74

I found out that since v. 2.9.0 of Udisks2 it is possible to set filesystem spesific mount parameters in the file '/etc/udisks2/mount_options.conf'.
(http://storaged.org/doc/udisks2-api/lat ... tions.html).
I cheched that both Fienix and MintPPC have an Uudisk version which is fresh enough to allow setting system level defaults for disks...
But for unknown some reason I cannot get Udisk2 to set noatime/nodiratime as defaults!

I have these lines at the beginning of the "/etc/udisks2/mount_options.conf":

Code: Select all

[defaults]
allow=exec,noexec,nodev,nosuid,atime,noatime,nodiratime,ro,rw,sync,dirsync,noload
But when I mount a partition (which has no entry in fstab) e.g. by opening it in Caja and check it with 'mount' command, instead of having 'noatime/nodiratime', it has 'relatime' which is the default set in the kernel.

So, what is wrong, why doesn't the 'mount_options.conf' has any effect?! Is it formulated in wrong way...?

If you have time, Christian, could you please see if you can get it to work...?
Last edited by Roland on Sat Apr 10, 2021 8:55 pm, edited 2 times in total.
- Roland -
Roland
Posts: 824
Joined: Tue May 02, 2017 7:23 am

Re: Default atime/relatime/noatime setting: Udisks2

Post by Roland »

Found finally a solution to the Udisk2 issue, just by testing... The "allow=" string was not able prevent the system from using the 'relatime' default for randomly mounted volumes. In addition, "default=noatime" was needed! Also "nodiratime" can be made default the same way.

Thus, the '/etc/udisks2/mount_options.conf' should look like this:

Code: Select all

[defaults]
allow=exec,noexec,nodev,nosuid,noatime,nodiratime,ro,rw,sync,dirsync,noload
defaults=noatime,nodiratime 
I recommend anyone who has a SSD drive (and wants to extend it's life by eliminating unnecessary writing operations) to use this config in Fienix and MintPPC !-) Unfortunately Ubuntu 16.04 cannot use it as the Udisks2 version is too old (2.9.0 is the minimun).

NOTE: It is important to add the 'noatime' (and 'nodiratime') parameter(s) also to '/etc/fstab', for each partition defined there, as fstab definitions override those made by Udisks2!
- Roland -
Post Reply