Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Can't mount partitions on file managers (Read 787 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Can't mount partitions on file managers

Hi again,  sorry if it's a noob question, but I just noticed that I can't mount disk partitions on thunar and pcmanfm-qt, error says "Not authorized to perform operation".
I also tried to test in i3, with the config that worked for arch before, which starts  /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 (which I think it's required for this kind of stuff), and indeed I have polkit in the active processes.

ps aux | grep polkit
prova     1380  0.0  1.0 545764 42068 ?        Ssl  14:59   0:00 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
polkitd   1387  0.0  0.2 380324  8112 ?        Sl   14:59   0:00 /usr/lib/polkit-1/polkitd --no-debug
prova     6833  0.0  0.0   7460  2176 pts/2    S+   17:01   0:00 grep --color polkit


 

Re: Can't mount partitions on file managers

Reply #3
Hello,

Have you managed the rights on this partition?
Sorry I don't know what you mean by that.

Other (maybe) relevant information:
 I have  these packages installed
gvfs, thunar-volman, udisks2, polkit, polkit-gnome, polkit-qt6.

Other things I tried:
Mounting in the terminal with "udisktctl -mount -b /dev/sda10" works, it spawns the dialog box asking for password as expected, which does not happen when I click on partitions in file managers.  This is happening regardless of the desktop environment I am using (LXQT, XFCE, or just i3).

Re: Can't mount partitions on file managers

Reply #4
Check if you have any polkit rules (in /usr/share/polkit-1/rules.d or /etc/polkit-1/rules.d) containing something like the following:
Code: [Select]
polkit.addRule(function(action, subject) {
    if (subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});
or
Code: [Select]
polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("storage")) {
        return polkit.Result.YES;
    }
});
You need to be a wheel or storage member for these to work.

Re: Can't mount partitions on file managers

Reply #5
I have these files in /usr/share/polkit-1/rules.d
50-default.rules  lightdm.rules  org.freedesktop.GeoClue2.rules  org.gtk.vfs.file-operations.rules.
The relevant ones seem:

Code: [Select]
cat 50-default.rules 
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

// DO NOT EDIT THIS FILE, it will be overwritten on update
//
// Default rules for polkit
//
// See the polkit(8) man page for more information
// about configuring polkit.

polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});



Code: [Select]
cat org.gtk.vfs.file-operations.rules 
// Allows users belonging to privileged group to start gvfsd-admin without
// authorization. This prevents redundant password prompt when starting
// gvfsd-admin. The gvfsd-admin causes another password prompt to be shown
// for each client process using the different action id and for the subject
// based on the client process.
polkit.addRule(function(action, subject) {
        if ((action.id == "org.gtk.vfs.file-operations-helper") &&
            subject.local &&
            subject.active &&
            subject.isInGroup ("wheel")) {
            return polkit.Result.YES;
        }
});

I am member of the wheel group


EDIT
I also have this file in the /etc/polkit-1/rules.d/  directory (which normal user has no read permission)
drwxr-x--- 2 root polkitd 4096 14 ago 20.00 /etc/polkit-1/rules.d/

Code: [Select]
cat 99-artix.rules 
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("storage")) {
        return polkit.Result.YES;
    }
});

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.power-off" ||
        action.id == "org.freedesktop.login1.reboot" ||
        action.id == "org.freedesktop.login1.hibernate" ||
        action.id == "org.freedesktop.login1.suspend") {
        return polkit.Result.YES;
    }
});

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.upower.hibernate" ||
        action.id == "org.freedesktop.upower.suspend") {
        return polkit.Result.YES;
    }
});
[Edited by a mod: add CODE tags]

Re: Can't mount partitions on file managers

Reply #6
Is the partition you're attempting to mount encrypted? Also, please use the CODE tags to enclose your file contents for readability.

Re: Can't mount partitions on file managers

Reply #7
No, it's not an encrypted partition


Re: Can't mount partitions on file managers

Reply #9
Code: [Select]
 ps ax | grep gvfs
 1382 ?        Sl     0:00 /usr/lib/gvfsd
 1390 ?        Sl     0:00 /usr/lib/gvfsd-fuse /run/user/1001/gvfs -f
 2665 ?        Sl     0:00 /usr/lib/gvfs-udisks2-volume-monitor
 2677 ?        Sl     0:00 /usr/lib/gvfs-mtp-volume-monitor
 2683 ?        Sl     0:00 /usr/lib/gvfsd-metadata
 2688 ?        Sl     0:00 /usr/lib/gvfsd-trash --spawner :1.3 /org/gtk/gvfs/exec_spaw/0
 2728 pts/0    S+     0:00 grep --color gvfs

I found out by chance while I was editing my .xinitrc, that if I start the session with dbus-launch like this
exec dbus-launch --sh-syntax --exit-with-session i3
I can mount partitions and I don't have this problem. The same happens in XFCE and LXQt

I am using sddm with the dinit init

Re: Can't mount partitions on file managers

Reply #10
Is this a base install? Because a quick testing of our DE ISOs didn't show mounting problems.

Re: Can't mount partitions on file managers

Reply #11
interesting.  I just solve this problem with fstab.  I've had troubles with gvfs becoming a run away process.


Re: Can't mount partitions on file managers

Reply #13
No it was an arch install, I switched to artix following this https://wiki.artixlinux.org/Main/Migration
Oh, that's a hard one to crack. It may be .pacnew files which need to be merged or local settings in your $HOME dir. To rule out the latter, create a new test user and see how it goes. Then merge .pacnew config files. Last option, backup your user directory, fresh install, copy back.

Re: Can't mount partitions on file managers

Reply #14
I tried with the new user, but that didn't work. It's a minor issue, that I can work around simply starting dbus-launch (in the  ls /usr/share/xsessions/ files too).  Thanks a lot for the help anyway  ;)