You are not logged in.

#1 2022-06-14 10:00:34

ThePeach
Member
From: Berlin, DE
Registered: 2014-06-08
Posts: 36
Website

udisks2 not reading its configuration

I'm trying to fix a permission problem with my NTFS external drive.

in /etc/udisks2/mount_options.conf I have the following two lines uncommented:

$ grep -e ^[^#] /etc/udisks2/mount_options.conf
[defaults]
ntfs_defaults=uid=$UID,gid=$GID,noatime,prealloc,noacsrules
ntfs_allow=uid=$UID,gid=$GID,umask,dmask,fmask,locale,norecover,ignore_case,windows_names,compression,nocompression,big_writes,noatime,prealloc,noacsrules

when I mount the three new options are not being applied:

$ udisksctl mount -b /dev/sda1
Mounted /dev/sda1 at /run/media/peach/Rugged Mini
$ mount | grep sda1
/dev/sda1 on /run/media/peach/Rugged Mini type ntfs3 (rw,nosuid,nodev,relatime,uid=0,gid=0,iocharset=utf8,uhelper=udisks2)

more than that, it's not even picking up the $GID/$UID of the user mounting the fs sad

Last edited by ThePeach (2022-06-23 14:39:56)

Offline

#2 2022-06-14 10:55:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,406

Re: udisks2 not reading its configuration

Did you restart the udisks daemon? Also the large majority of these parameters are not applicable to ntfs3 and are for ntfs3-g only (... window_names, compression, big_writes) your main "problem" will be noacsrules which automatically ignorse uid and guid and makes everything root owned yet accessible to everyone, see: https://www.kernel.org/doc/html/latest/ … nt-options

Offline

#3 2022-06-14 11:24:21

ThePeach
Member
From: Berlin, DE
Registered: 2014-06-08
Posts: 36
Website

Re: udisks2 not reading its configuration

thanks V1del, I was unaware of the daemon and thought the config was read runtime.
I noticed that the service was not running (!) and started it, I also removed the noacrules option to see if it was picking up the GID/UID but to no avail. Am I doing something wrong here?

$ grep -e ^[^#] /etc/udisks2/mount_options.conf
[defaults]
ntfs_defaults=uid=$UID,gid=$GID,noatime,prealloc
ntfs_allow=uid=$UID,gid=$GID,umask,dmask,fmask,locale,norecover,ignore_case,windows_names,compression,nocompression,big_writes,noatime,prealloc,noacsrules
$ sudo systemctl restart udisks2
$ udisksctl mount -b /dev/sda1
Mounted /dev/sda1 at /run/media/peach/Rugged Mini
$ mount | grep sda1
/dev/sda1 on /run/media/peach/Rugged Mini type ntfs3 (rw,nosuid,nodev,relatime,uid=0,gid=0,iocharset=utf8,uhelper=udisks2)

consider that I'm under Gnome so my assumption here is that it has its own wrapper around udisks2 for mounting/unmounting
I also noticed that there is no indication anywhere in the udisks page in the wiki that the udisks2.service should be enabled/started

Last edited by ThePeach (2022-06-14 11:24:37)

Offline

#4 2022-06-21 09:19:30

ThePeach
Member
From: Berlin, DE
Registered: 2014-06-08
Posts: 36
Website

Re: udisks2 not reading its configuration

bump?

Offline

#5 2022-06-21 10:36:55

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 3,962

Re: udisks2 not reading its configuration

ThePeach wrote:

bump?

Don't do that. https://wiki.archlinux.org/title/Genera … es#Bumping


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#6 2022-06-21 13:13:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,406

Re: udisks2 not reading its configuration

Is the wrong mount line an actual problem? While it "shouldn't" be the case for ntfs3 at least on ntfs-3g it was common to have root be the uid/gid, but the actual perms on the mount point (e.g.

ls -l "/run/media/peach/Rugged Mini"

) are correct as per the given logistics.

... and again, noacsrules specifically and intentionally and logically correctly overrides any other UID/GID considerations, as long as you keep that parameter  then everything is totally as expected, the mount point will be "root owned" but everything will be writable and executable by everyone. Also note that ntfs does inherently not actually understand or provide a one to one mapping to your posix permissions, so while this might read strangely, it should not have any inherent adverse effects for the file system.

As for the service status confusion, it doesn't really matter, it will be autostarted by the relevant desktop wrappers in any and all cases, and assuming you'd wanted to check whether the config file applies or not I suggested you might have to restart the service to have a change there considered.

Maybe also elaborate on your actual real permissions problem. Instead of focusing on udisks and the relevant representation in the mount output, what are you actually trying to do that makes you think that this is a permissions problem? Do you try to write to the disk and can't? or what's your actual real problem? If you generally can't write regardless of "permissions" it's likely you didn't turn off Windows fastboot/had the drive connected to Windows when shutting that down without fast boot disabled.

Last edited by V1del (2022-06-21 13:21:20)

Offline

#7 2022-06-23 14:39:15

ThePeach
Member
From: Berlin, DE
Registered: 2014-06-08
Posts: 36
Website

Re: udisks2 not reading its configuration

Thanks @V1del for getting back to me.

So there are two topics here that I would like to distinguish:

1. by default I can't get write permissions for my user on the external NTFS USB drive I have. I have added both the udisks2 and udev changes as suggested in the wiki, but the Udev one was causing errors at mount time (i.e. when trying to automount via Gnome, I was getting a wrong FS error, so had to manually mount it). I actually applied the udev one because udisks2 didn't seem to work...

Given the above I tried to remove the Udev rule and have it working via Udisks, hence the reason for this post:

2. Udisks, unfortunately, doesn't seem to pick up/read its configuration. As per my previous post I removed the noacsrules option, re/started the daemon but when mounting (both manually and via Gnome wrapper) I don't see the noatime/prealloc option being applied. I'm also expecting my current user to be used as owner of the files in the FS, which is not the case. Even worse, when I used the noacsrules the FS kept on having the same mask on all files/dirs (i.e. not writable by the group/others).

Am I doing something wrong here? as per #1, that's currently not my main focus. I just want to understand what's going on with Udisks and how to fix it.

(I have updated the title of the post to reflect the content of the post/question)

Last edited by ThePeach (2022-06-23 14:40:22)

Offline

Board footer

Powered by FluxBB