The default mount option of /var subvolume of Btrfs


I am just a little confused about an expression in Reference Book:

This directory contains many variable files, including logs, temporary caches, third party products in /var/opt, and is the default location for virtual machine images and databases. Therefore this subvolume is created to exclude all of this variable data from snapshots and has Copy-On-Write disabled.

And according to this section, YaST seems to disable Copy-On-Write of /var by adding a nodatacow mount option by default.

However, according to btrfs(5), it seems impossible to set per-subvolume nodatacow, nodatasum, or compress using mount options. These mount options will apply to the whole filesystem.

So how does openSUSE disable Copy-On-Write of /var subvolume? I think with nodatacow mount option, the whole filesystem will have Copy-On-Write disabled, and we will lose it benefit.

In particular, I have Snapshot disabled when installing the system, and enable it after installing. Then I notice the expression in Reference Book, so I check my /etc/fstab, there is no nodatacow mount option of /var subvolume, so I wonder if I should add this mount option.

I would be glad if someone could help me clarify this, thanks!

I just check my Btrfs subvolumes by YaST, and /var subvolume has a yes symbol of **noCoW.

**It makes me more confused. So does YaST has it own mechanism to control the mount option of subvolume instead of following /etc/fstab? And does this yes symbol of **noCoW **only effect /var subvolume rather than the whole file system like /etc/fstab?

I do not see this section mentioning mount option anywhere.

Installation sets “no CoW” attribute on /var. See output of “lsattr -d /var”.

Thanks for your clearfication. Now I understand how does YaST worklol!