Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
✅ Unable to mount via udisks an NTFS partition with uid, gid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
acarstoiu
Apprentice
Apprentice


Joined: 20 Oct 2004
Posts: 197

PostPosted: Thu Oct 03, 2024 6:28 pm    Post subject: ✅ Unable to mount via udisks an NTFS partition with uid, gid Reply with quote

Hi.
I'm running a standard configuration of udev, udisks and polkit. That is, I have never touched their out-of-the-box configuration.

If an external USB storage device is plugged in, as a regular user, I have the possibility to mount its partitions from the Plasma tray (KDE user here), using the "Disk and devices" widget. Because polkit allows it, the mount succeeds, but the mounted NTFS filesystem is owned by root and uses the standard umask, so the partition is basically read-only for me (I can become root, but that's out of the question as a solution).
Another external device (an SD card) that is formatted as FAT is mounted just fine with all files belonging to my user and my default group. The mount documentation shows that this is default handling for uid and gid mount options for both FAT and NTFS filesystems.

I went on and placed the supposedly built-in configuration of udisks in the /etc/udisks2/mount_options.conf configuration file
Code:
ntfs:ntfs3_defaults=uid=$UID,gid=$GID
ntfs:ntfs3_allow=uid=$UID,gid=$GID,umask,dmask,fmask,iocharset,discard,nodiscard,sparse,nosparse,hidden,nohidden,sys_immutable,nosys_immutable,showmeta,
noshowmeta,prealloc,noprealloc,hide_dot_files,nohide_dot_files,windows_names,nocase,case

(yes, I'm using the kernel driver), then unmounted and reinserted the USB storage device. No change, the NTFS partition is still mounted owned by root. I checked the standard configuration of udev for udisks and found nothing to explain why the settings above do not take effect :(


Moderator note: Fixed long line problem. -- Banana


Last edited by acarstoiu on Tue Oct 08, 2024 6:19 am; edited 1 time in total
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4670
Location: Germany

PostPosted: Fri Oct 04, 2024 4:08 am    Post subject: Reply with quote

Hi,
I using it for my external USB-Disk with a fstab entry, whit the user mount option.
working fstab example entry:
PARTUUID=70df7e72-8b3a-4b20-afd8-1cf4xxxxxxxx   /mnt/mypassport         ntfs3           noauto,user,prealloc            0 0
udisks respects this entry - and it works with the kde plasma device notifier too.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22727

PostPosted: Fri Oct 04, 2024 10:28 am    Post subject: Reply with quote

OP: after this is mounted, what does the /proc/self/mountinfo line for this filesystem show? The first step is to understand whether your mount options are present but ineffective, or missing entirely.
Back to top
View user's profile Send private message
acarstoiu
Apprentice
Apprentice


Joined: 20 Oct 2004
Posts: 197

PostPosted: Fri Oct 04, 2024 6:46 pm    Post subject: Reply with quote

Hu wrote:
OP: after this is mounted, what does the /proc/self/mountinfo line for this filesystem show? The first step is to understand whether your mount options are present but ineffective, or missing entirely.

Code:
48 20 8:5 / /run/media/*** rw,nosuid,nodev,relatime - ntfs3 /dev/sda5 rw,uid=0,gid=0,iocharset=utf8

I have even modified the /etc/udisks2/mount_options.conf file to say noatime and the above line remains the same. So it looks like I'm editing the wrong file, one way or the other. I checked the log files, including dmesg output and I saw nothing relevant. Documentation says there's no need to restart udisks, not that I have it as an init service.
I also checked that something is running with the name udisks:
Code:
# ps ax | fgrep udisks
2583 ?        Sl     0:08 /usr/libexec/udisks2/udisksd


I do not want to place an entry in /etc/fstab for each device that I might have.
Back to top
View user's profile Send private message
acarstoiu
Apprentice
Apprentice


Joined: 20 Oct 2004
Posts: 197

PostPosted: Tue Oct 08, 2024 6:24 am    Post subject: Reply with quote

Found it :) I forgot I applied some time ago this advice and my NTFS partitions have type ntfs3 instead of ntfs.
So the rules for udisks2 must be written as
Code:
ntfs3_defaults=...
ntfs3_allow=...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum