I am experimenting with an external usb drive + luks + btrfs filesystem. When I plug this drive into the computer nautilus prompts we for the password and the btrfs filesystem is mounted underneath /run/media/ . That works fine.
But how can I add special btrfs mount options to this process? e.g. compress=zstd:10 ?
udisk2 is responsible for mounting usb devices when they are plugged in. It is possible to set mount default options for udisk2 in /etc/udisks2/mount_options.conf. But this is too generic for me. If I set btrfs_defaults on udisk2 level, it will be the default for ALL usb disks with a btrfs filesystem. I am not sure if I want that.
So now I am doing it with a udev rule which is specific to this one usb drive: