Udisksctl mounting of btrfs doesn't give desired user permissions

Hi, I am trying to setup an external drive with full disk encryption and a single btrfs partition. I have done a similar thing with ext4 in the past. I can create the partition with KDE Partition Manager where I select that the permissions should be for everyone.

After this I can mount it through Dolphin or with udisksctl, however, in both cases instead of mounting the partition such that my user has permissions it is mounted such that root is the only account with write permissions. I can see the mounted partition and I can create files with sudo.

Is there some configuration option I can change? Is this something I need to fix when creating the drive?

Here is the output from ls when I have both my LUKS+ext4 and LUKS+btrfs disks mounted at the same time through Dolphin

>>> ls /run/media/rabarbra
drwxrwxrwx. 24 root users 4096 Sep 26  2022 myext4
drwxr-xr-x.  1 root root     0 Mar 29 08:58 mybtrfs

Mount the filesystem and try changing the permissions:

sudo chmod a+rw /run/media/${USER}/mybtrfs
2 Likes
sudo chgrp -c users /run/media/rabarbra/mybtrfs
1 Like

Thanks @vgaetera and @augenauf

I ended up doing chown root:users and that didn’t work, but I noted that the other drive has permissions 777, so I running chmod 777 which of course worked. Is this something that should be done somehow when formatting the drive, or is it only something that can be fixed after mounting it with udisksctl?

It seems these changes persist over reboot and remounting. I will have to check if they persist to a new computer.

1 Like

It depends on the options available behind the Advanced button on your screenshot.
This problem could be caused by selecting Btrfs, or LUKS, or a combination of both.

1 Like

It only allows specifying sector alignment

1 Like

Then it looks like a bug, assuming the Permissions option is not working as expected.

Ok. I was a bit unsure how “Permissions” gets applied. Is this something set on the btrfs root volume? My initial searches and reading didn’t lead me to any examples or documentation of setting this with mkfs or btrfsprogs, but i found many posts about setting the permissions and ownership of the mount point.

I don’t think the sector alignment is related to the problem, but LBA 34 is not 4KiB aligned and should not be used or the default with any modern hardware. It won’t hurt anything, but it’s suboptimal, in particular for file systems that use 4KiB block sizes. Btrfs only supports 4KiB and larger. ext4 and XFS can support smaller, but they also prefer 4KiB as the minimum block size these days.

2 Likes

Hmm, is that a bug/issue that should be filed as well then?