You are not logged in.

#1 2020-12-22 14:11:27

pabloski
Member
Registered: 2007-03-14
Posts: 31

Udisks2 strange behaviour

Sorry for posting this here, but I cannot post to System Administration.

I have seen a strange behaviour by udisks2, related to how it mounts volumes. First, it mounts every "external" volume as nosuid, nodev by default. Everything except the root fs is seen as something dangerous. The problem is that I want to use a 1 TB SATA SSD, XFS formatted, as storage for containers. However I can solve this glitch by remounting the volume. An annoyance, but not a big one.

But the real strange thing is how it mounts a partition on another SSD. It is the same SSD where the rootfs is and it is a nvme SSD. The point is that it mounts the volume with my current user and gid=1001. Good. I can manipulate files inside it with my user account. But the same isn't true for the 1TB SATA SSD, because it is mounted as root!!! Why the difference?

It is really puzzling to me why these partitions are treated differently.

Offline

#2 2020-12-22 15:17:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,652

Re: Udisks2 strange behaviour

However I can solve this glitch by

…adding an fstab entry, http://storaged.org/doc/udisks2-api/lat … tions.html

it mounts the volume with my current user and gid=1001

Cause it's not a POSIX FS (vfat)?
Real FS aren't mounted w/ global ownership or permissions, because the FS manages them per file. That's not related to udisks, but the FS.

Offline

#3 2020-12-22 15:27:25

pabloski
Member
Registered: 2007-03-14
Posts: 31

Re: Udisks2 strange behaviour

seth wrote:

However I can solve this glitch by

…adding an fstab entry, http://storaged.org/doc/udisks2-api/lat … tions.html

Yes, but there are two problems. (1) I don't want to lose the flexiblity of adding/removing/updating the storage mediums for the containers ( without being forced to update fstab every time ). (2) It works when I mount it manually or from Gnome Disks, but it doesn't work from Gnome Files. The volume simply disappears from Gnome Files and it doesn't get mounted.


seth wrote:

Cause it's not a POSIX FS (vfat)?
Real FS aren't mounted w/ global ownership or permissions, because the FS manages them per file. That's not related to udisks, but the FS.

No, it is ext4, while the SATA SSD has a xfs filesystem on it. Maybe the defaults for udisks2 are to mount ext4 filesystems as the current user and others as root.

These should be the defaults http://storaged.org/doc/udisks2-api/lat … tions.html

There is nothing about ext4 sadly.

And it is common practice in the Unix world to NOT mount a filesystem with the current user id, but instead use the fs root owner property ( for fs that support it, like ext4 ).

But udisks2 seems to violate this rule for ext4 filesystems.

Last edited by pabloski (2020-12-22 15:29:12)

Offline

#4 2020-12-22 15:45:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,652

Re: Udisks2 strange behaviour

You cannot mount ext4 w/ certain UID/GUD - it's the FS itself that brings those and changing the permissions (on eg. its root) should™ be reflected on the next mount.

As the linked doc says:

Apart from the final computed options UDisks always adds the following options: nodev, nosuid, uhelper=udisks2 no matter if included in _allow or not. These are hardcoded and can't be changed.

You will have to use some fstab entry to "override" that.
(No, I don't believe that this is a good thing in udisks. I think it's fucking gnome mentality of "we know better than you what you want". But it is what it is.)

Maybe matching the fstab entry by label(s) is a viable option?

Offline

Board footer

Powered by FluxBB