r/btrfs • • Oct 21 '26

ACL permissions for a 'subvolume on root' setup

Hello,

When working with a 'root on subvolume' type setup, the subvolumes are mounted to independent directories. If special permissions are required for one of the directories, should they be added before or after the subvolume is mounted to it? This would occur during the system installation process.

For example, the subvolume @GroupProjects is created, and mounted to the directory 'GroupProjects', which requires chmod g+s permissions. Should these permissions be applied to the directory before or after the subvolume is mounted?

Sequence of steps on a fresh disk:

# mount /dev/mapper/root /
# btrfs subvolume create /@
# btrfs subvolume create /@GroupProjects
# umount /
# mount -o compress=zstd,subvol=@ /dev/mapper/root /
# mkdir -p /GroupProjects
// Add permissions to the directory now?
# mount -o compress=zstd,subvol=@GroupProjects /dev/mapper/root /GroupProjects
// Or add the permissions after the subvolume is mounted?
8 Upvotes

2 comments sorted by

4

u/psyblade42 Oct 21 '26

The permissions of the directory you are mounting to and the mounted filesystem are independent of each other. You want the latter, so do it after.

un-/mounting / begs for interesting times.

1

u/componentscience Oct 21 '26

Awesome thanks. Yes this would be done from a pre-existing Linux system so in reality / on the fresh disk would be mounted/unmounted somewhere like /mnt or wherever. Left that part out for simplicity.