I am trying to allow my backup program to take a snapshot of my filesystem. The goal is to create a snapshot for the duration of the backup to ensure a consistent view then the snapshot can be deleted.
However it appears that creating a backup as a user is not allowed.
% btrfs subvolume snapshot / test
Create a snapshot of '/' in './test'
ERROR: cannot snapshot '/': Operation not permitted
I have tried mounting with the user_subvol_rm_allowed which works but it would require updating the owner of / to one specific user. Not only does this not work with multiple users but it gives them write access to the drive. (My understanding is that after a snapshot file permissions are identical so it doesn't actually give any more access.) It doesn't appear to work with groups even if that group has write access to the directory.
Is there a solution to giving a particular user access to snapshot (and remove) this volume? The best option I have found so far is allowing a specific set of commands via sudo which should work but I don't love. I would rather if there was a way to grant this specific capability.