Should "noatime" be added to btrfs subvolumes?

Hello,

Every guide I have read recommends adding “noatime” to fstab. Problem is, they use ext4, I use btrfs, because of snapshots.
Part of my fstab looks like this

UUID=13ea1d13-7c4a-4f3b-bc61-56757d80322d / btrfs defaults 0 0
UUID=13ea1d13-7c4a-4f3b-bc61-56757d80322d /boot/grub2/i386-pc btrfs subvol=boot/grub2/i386-pc 0 0
UUID=13ea1d13-7c4a-4f3b-bc61-56757d80322d /boot/grub2/x86_64-efi btrfs subvol=boot/grub2/x86_64-efi 0 0
UUID=13ea1d13-7c4a-4f3b-bc61-56757d80322d /srv btrfs subvol=srv 0 0
UUID=13ea1d13-7c4a-4f3b-bc61-56757d80322d /tmp btrfs subvol=tmp 0 0
UUID=13ea1d13-7c4a-4f3b-bc61-56757d80322d /usr/local btrfs subvol=usr/local 0 0
UUID=13ea1d13-7c4a-4f3b-bc61-56757d80322d /var/crash btrfs subvol=var/crash 0 0

My question is: Should I add “noatime” to each subvolume or only to “/”, the first line?

Edit: I am not using a SDD. I am just messing around on an old laptop

On 2015-08-18 00:56, GreenMint wrote:

> My question is: Should I add “noatime” to each subvolume or only to “/”,
> the first line?

I think you can add it, but it is unsure if it will have the performance
impact it has on other filesystems. Try and report :slight_smile:

You probably have to enter it in all the subvolumes.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

You may want to check out this there may be some downsides depending on the apps run

https://btrfs.wiki.kernel.org/index.php/Mount_options

On 2015-08-18 02:16, gogalthorp wrote:
>
> You may want to check out this there may be some downsides depending on
> the apps run
>
> https://btrfs.wiki.kernel.org/index.php/Mount_options

Very interesting, thanks :slight_smile:

Two paragraphs are of special interest here for the OP:

Most mount options apply to the whole filesystem, and only the options
for the first subvolume to be mounted will take effect. This is due to
lack of implementation and may change in the future.

Performance

noatime - as discussed in the mailing list noatime mount option
might speed up your file system, especially in case you have lots of
snapshots. Each read access to a file is supposed to update its unix
access time. COW will happen and will make even more writes. Default is
now relatime which updates access times less often (see:
http://kerneltrap.org/node/14148).

Note that noatime will break some applications like the venerable mutt
(unless you use Maildir mailboxes).


Instead of noatime, you may use relatime, which doesn’t break “mutt”, if
that is an issue. This is reccomended in general, for any Linux
filesystem, unless file read accounting is an issue.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

relatime is default on in BTRFS

Not only in btrfs, but openSUSE in general I think.

At least “mount” says “relatime” for all mounts here (using reiserfs as root filesystem), and I never added it specifically anywhere…

I’m seeing that in all but 4 mounts:


% mount | grep -v relatime
devtmpfs on /dev type devtmpfs (rw,nosuid,size=4022916k,nr_inodes=1005729,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)

Yeah, right.
Those 4 don’t have it here either, but they are not real filesystems anyway.

Just because “relatime” is set by default doesn’t meant that you cannot mount without it… :wink:

Thanks for the answers. I added it. I felt no difference whatsoever

You will feel no difference any changes to timing are relatively small and under human perception. You would need to run benchmarks to see any differences

On 2015-08-18 14:46, GreenMint wrote:
>
> Thanks for the answers. I added it. I felt no difference whatsoever

It is not that easy to notice. You have to do accurate stress testing.
Or find an usage pattern that makes it noticeable.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))