[Solved] Jessie, Mounting drives as normal user, GUI apps

Getting your soundcard to work, using Debian on non-i386 hardware, etc

[Solved] Jessie, Mounting drives as normal user, GUI apps

Postby greescom » 2015-05-13 13:07

Spent hours on this problem now, I'm pretty sure it's something really simple though so thought I'd stick it on here.

I have two internal partitions that I auto-mount at startup using fstab. This works fine & I can unmount/mount as a normal user no problem in the terminal (umount /dev/sdb1) but using thunar (or nautilus) I receive a message saying "not authorised to perform operation" (I use the DWM window manager, in gnome it pops up with a password prompt).

If I open thunar as root then I can mount/unmount.

The strange thing is I can mount/unmount usb sticks or mtp devices as a normal user no probs from thunar! So, I'm assuming it must be my fstab that's the problem?

here it is:
Code: Select all
LABEL="DebianLive"             /                ext4    errors=remount-ro    0      1
/dev/sda6                      none             swap    sw                   0      0

/dev/disk/by-label/Vault       /media/Vault     ext4    users,auto,exec      0      0
/dev/disk/by-label/LiveJob     /media/LiveJob   ext4    users,auto,exec      0      0



This used to work fine on my wheezy install, only started having problems when I switched to Jessie

Any ideas?
Last edited by greescom on 2015-05-13 21:28, edited 1 time in total.
greescom
 
Posts: 2
Joined: 2015-05-13 12:47

Re: Jessie - Mounting internal drives as normal user in GUI

Postby L_V » 2015-05-13 20:37

Assuming udisks2 is installed, you should have a look to /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy

Code: Select all
  <action id="org.freedesktop.udisks.filesystem-mount"> 
   <description>Mount a device</description> 
   <message>Authentication is required to mount the device</message> 
   <defaults> 
    <allow_any>no</allow_any> 
    <allow_inactive>yes</allow_inactive> 
    <allow_active>yes</allow_active> 
   </defaults> 
  </action> 
L_V
 
Posts: 1031
Joined: 2007-03-19 09:04

Re: Jessie - Mounting internal drives as normal user in GUI

Postby greescom » 2015-05-13 21:27

Thank you so much, that put me on the right track.

I'd messed with polkit stuff while trying to get it to work but i'd been editing 'udisks.policy' to no effect.

Editing 'udisks2.policy' sorted it.

------------------------------------------

For anyone else having this problem edit:
/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy

and change
<allow_active>auth_admin_keep</allow_active>
to
<allow_active>yes</allow_active>

under
<action id="org.freedesktop.udisks2.filesystem-mount-system">
&
<action id="org.freedesktop.udisks2.filesystem-unmount-others">
greescom
 
Posts: 2
Joined: 2015-05-13 12:47

Re: [Solved] Jessie, Mounting drives as normal user, GUI app

Postby L_V » 2015-05-14 07:38

Great.
I never found a clean way to manage policy-kit, but listing udisks2 actions may also help to find the relevant setting:

Code: Select all
pkaction | grep udisks2
L_V
 
Posts: 1031
Joined: 2007-03-19 09:04

Re: [Solved] Jessie, Mounting drives as normal user, GUI app

Postby milomak » 2015-10-20 21:32

great stuff.

this helped me stop the password being asked when i mount or unmount a usb drive.

i also added <action id="org.freedesktop.udisks2.eject-media"> to be able to unmount from a file manager
Desktop: iMac Late-2015 27" 5K Retina (17,1 - 3.3GHz) - MacOS and Windows 10 (Bootcamp)/ Debian Sid (External SSD)
Laptop: Lenovo ideapad Y700 [nVidia Optimus] (64-bit) - Debian Sid, Win10,
Kodi Box: AMD Athlon 5150 APU w/Radeon HD 8400 - Debian Sid
milomak
 
Posts: 1972
Joined: 2009-06-09 22:20


Return to Hardware

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable