You are not logged in.

#1 2021-11-17 23:18:37

Strangiato
Member
Registered: 2020-01-10
Posts: 521

[solved] Dolphin asks for password to mount/unmount partitions

Hi
I use fully updated Arch + KDE Plasma. The followiing partitions are mounted on boot:

/dev/sdb1: LABEL="SEAGATE" BLOCK_SIZE="512" UUID="352E012E68711569" TYPE="ntfs" PARTUUID="0000cdfd-01"
/dev/sdc1: LABEL="2TB" BLOCK_SIZE="512" UUID="4020C22320C21FB0" TYPE="ntfs" PARTUUID="0f967ca5-01"
/dev/sda4: LABEL="WD" UUID="f9914052-8649-4101-a116-b276b2160566" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="053ee8b3-04"
/dev/sda2: LABEL="WIN7" BLOCK_SIZE="512" UUID="5CF2F3CCF2F3A882" TYPE="ntfs" PARTUUID="053ee8b3-02"

When I want to mount or unmount any of them manually for any reason, Dolphin file manager asks for password.

Here is my /etc/fstab file:

# UUID=4c1b8d88-ae03-4daa-9733-103cfeffdd81
/dev/sda3               /               ext4            rw,relatime     0 1

LABEL=WD /mnt/WD auto user,nosuid,nodev,nofail,x-gvfs-show 0 0
LABEL=WIN7 /mnt/WIN7 ntfs3 nosuid,nodev,nofail,x-gvfs-show,uid=1003,umask=000,acl 0 0
LABEL=SEAGATE /mnt/SEAGATE ntfs3 user,nosuid,nodev,nofail,x-gvfs-show,uid=1003,umask=000,acl 0 0
LABEL=2TB /mnt/2TB ntfs3 user,nosuid,nodev,nofail,x-gvfs-show,uid=1003,umask=000,acl 0 0

How can I set my system to mount/unmount these partitions without authentication?
Thanks.

Last edited by Strangiato (2021-11-18 17:12:59)

Offline

#2 2021-11-18 00:51:00

Soultrigger
Member
From: Brazil
Registered: 2021-11-04
Posts: 111

Re: [solved] Dolphin asks for password to mount/unmount partitions

If it helps you somehow, I will share my fstab:

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda4 LABEL=root
UUID=fcaf7468-bad7-4ce5-a5dc-1e0967dc37ba	/         	ext4      	rw,relatime	0 1

# /dev/sda5 LABEL=home
UUID=61c81df5-1a71-43be-8292-f21101fbf883	/home     	ext4      	rw,relatime	0 2

# /dev/sda1
UUID=6760-C330      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/sdb5 LABEL=swap
UUID=a697f8f8-fb4a-4074-92fe-87ad8f82f8f6	none      	swap      	defaults  	0 0

# /dev/sda3
UUID=88B29492B294867A                      /mnt/NTFS/Windows    ntfs         uid=1000,gid=1000        0 0

# /dev/sda6
UUID=CEEE8F1FEE8EFF49                      /mnt/NTFS/Games      ntfs         uid=1000,gid=1000        0 0

# /dev/sdb1
UUID=6CC27562C2753206                   /mnt/NTFS/GamesHDD      ntfs         uid=1000,gid=1000        0 0

# /dev/sdb2
UUID=AC0ACAA40ACA6AC2                    /mnt/NTFS/Arquivos     ntfs         uid=1000,gid=1000        0 0

# dev/sdb3
UUID=4C7E7A057E79E7DA                     /mnt/NTFS/Media       ntfs         uid=1000,gid=1000        0 0

# dev/sdb4
UUID=2464D92A64D8FF8A                    /mnt/NTFS/Backup       ntfs         uid=1000,gid=1000        0 0

All my NTFS drives mounts without issue. I also used this other options for a while: defaults,rw,nls=utf8,umask=000,dmask=022,fmask=133,uid=1000,gid=1000,windows_names

If I would guess is that since you are using something very similar to a guide I saw, you might need to use chown and chgrp to become the owner of the device/mount, If I recall correctly it is because of nosuid option. But I am a Linux noob, so take it with caution,

Here is the guide: https://github.com/FizzleFuze/SteamNTFS … /README.md

Last edited by Soultrigger (2021-11-18 00:52:00)

Offline

#3 2021-11-18 00:56:43

Soultrigger
Member
From: Brazil
Registered: 2021-11-04
Posts: 111

Re: [solved] Dolphin asks for password to mount/unmount partitions

I also found this information in google:

Unfortunately this (mounting NTFS with suid and dev options from fstab) may not possible without modifying NTFS-3G or mount(8).

The problem is, the mount(8) program doesn't pass dev, suid and some other default options to related helper program, in this case /sbin/mount.ntfs; because they are considered default. These options should be effective and works if you are using the mount helper program directly: mount.ntfs -o exec,dev,suid /dev/disk/by-uuid/CE20D46C20D45D51 /mnt/data1

The workaround I recommended is to modify NTFS-3G to remove the default nodev and nosuid.

It might also be useful to look at the Mount man page: https://linux.die.net/man/8/mount. I advise to search for the nosuid options.

Last edited by Soultrigger (2021-11-18 00:57:09)

Offline

#4 2021-11-18 07:57:27

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

Re: [solved] Dolphin asks for password to mount/unmount partitions

/usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy - check for "org.freedesktop.udisks2.filesystem-mount-system" and "org.freedesktop.udisks2.filesystem-fstab". The default to auth_admin and lack allow_active.
You'll have to add overriding rules, see https://wiki.archlinux.org/title/Polkit

Offline

#5 2021-11-18 12:58:33

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: [solved] Dolphin asks for password to mount/unmount partitions

After reading the following articles from the wiki, it was not clear to me how to override the default rules.

https://wiki.archlinux.org/title/Polkit#Udisks

https://wiki.archlinux.org/title/File_m … partitions

https://wiki.archlinux.org/title/Udisks#Configuration

After thinking on things that I read in internet about this issue (but with other distros) before creating this topic,
I have edited these actions in /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy file, as root:

org.freedesktop.udisks2.filesystem-mount-system
org.freedesktop.udisks2.filesystem-fstab

I have changed their "defaults" sections from

<defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
</defaults>

to

<defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
</defaults>

But the partition labeled 'WIN7' was still asking for password after these steps. Then I added 'user' mount option to its line in /ect/fstab file and now no partition asks for password on mounting/unmonting with Dolphin. \o/

Offline

#6 2021-11-18 16:07:57

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

Re: [solved] Dolphin asks for password to mount/unmount partitions

nb. that the action change is
1. likely reverted w/ the next update (see the big fat note in the wiki)
2. Highly insecure - allowing the active user only should™ suffice in any event.

Try a rule like (untested)

polkit.addRule(function(action, subject) {
        if (((action.id == "org.freedesktop.udisks2.filesystem-fstab") ||
            (action.id == "org.freedesktop.udisks2.filesystem-fstab")) &&
            subject.local && subject.active) {
            return polkit.Result.YES;
        }
});

Offline

#7 2021-11-18 17:12:18

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: [solved] Dolphin asks for password to mount/unmount partitions

Ok, I have reverted my changes, created a .rules file in /etc/polkit-1/rules.d/ containing your rule and it works. smile
Thank you very much, seth.

Offline

#8 2021-11-18 17:21:04

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

Re: [solved] Dolphin asks for password to mount/unmount partitions

There's actually a typ… errr… "copypastablunder" in the rule - one of the tested actions should be "org.freedesktop.udisks2.filesystem-mount-system"

Offline

#9 2021-11-18 17:33:51

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: [solved] Dolphin asks for password to mount/unmount partitions

Oh, fixed now.

polkit.addRule(function(action, subject) {
        if (((action.id == "org.freedesktop.udisks2.filesystem-fstab") ||
            (action.id == "org.freedesktop.udisks2.filesystem-mount-system")) &&
            subject.local && subject.active) {
            return polkit.Result.YES;
        }
});

Thanks again. smile

Offline

Board footer

Powered by FluxBB