You are not logged in.

#1 2011-03-27 18:12:42

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Normal user mounting permissions [SOLVED]

Hello everybody smile I am a brand new Arch user and have encountered an issue that i have not been able to fix trough extensive forums/wiki/google reading. I wish my first post would've been more... useful, but I've been stuck on this one for a good while now...

Here is the issue: Whenever i try to mount (automount right now) as a normal user, i get a "not authorized" message. As of now, it automounts fine if i access my file manager as root. It just seems like i am not able to allow the normal user to have permission to read/write/access/ANYTHING on my usbs, CDs or external drives.

Right now i am using Fluxbox, slim, pcmanfm along with udisks (and udiskie). I have tried many solutions and propositions on the same topic. Here is my xinitrc file :

DEFAULT_SESSION=fluxbox
case $1 in
        awesome) exec awesome ;;
        fluxbox) exec udiskie & ck-launch-session dbus-launch startfluxbox ;;
        *) exec $DEFAULT_SESSION ;;
esac

I also followed Udiskie's wiki to grant (i tought) the normal user the permission to mount, and the pcmanfm's wiki

dbus is loaded in the daemons

From what i have read, my hopes are to be able to avoid hal (even though i tried many options with hal and it didn't work) and i would also like not to have to specify my drives to fstab. Basically, i want to grant the normal user the ability to read, write, mount and unmount my usb drives and many other things.

I've read about the udev rules, but from what i understood it should not be required with pcmanfm and udisks. (to be very honest, i'd prefer to avoid the udev rule thing and find a fix using a method i understand myself rather than copying code someone else has written for me)

Hopefully i have provided enough information for someone to figure something out of this.

Thanks,

Kalmar smile


Here is what i did to make it work: You want to configure the /etc/slim.conf file. Replace

 login_cmd           exec /bin/bash -login ~/.xinitrc %session 

with

 login_cmd           exec ck-launch-session dbus-launch /bin/bash -login ~/.xinitrc %session 

.

A very simple solution that fixes the permission issues that i encountered.

Thanks to everybody who helped out smile

Last edited by Kalmar (2011-03-28 00:12:37)

Offline

#2 2011-03-27 19:40:20

whatshisname
Member
Registered: 2010-04-24
Posts: 163

Re: Normal user mounting permissions [SOLVED]

Kalmar wrote:

i would also like not to have to specify my drives to fstab. Basically, i want to grant the normal user the ability to read, write, mount and unmount my usb drives and many other things.

Despite your desires, my problems along these lines were solved by putting entries into /etc/fstab.  For ex., here's the line from my /etc/fstab for my sansa mp3 player:

    /dev/disk/by-uuid/98D4-D627 /media/sansa_clip vfat users,exec,noauto 0 0

It doesn't automount.  You still have to click the icon in pcmanfm to mount it.  But I'm fine with that.

Offline

#3 2011-03-27 21:07:10

CPU Gastronomy
Member
From: Québec, Canada
Registered: 2010-12-29
Posts: 69

Re: Normal user mounting permissions [SOLVED]

What are the permissions on the mounted directories ? (i.e. : ls -l /path/to/the/parent/directory )

Also, are you in the group storage ?  (Don't forget to completly logout after the user is added to the group).

Last edited by CPU Gastronomy (2011-03-27 21:08:53)

Offline

#4 2011-03-27 21:42:23

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Re: Normal user mounting permissions [SOLVED]

Whatshisname : Thanks, this has solved the Cd/dvd part of my problem, along with my ntfs partitions are now being recognized (though i can't read/write, but it is not my main concern for now). However since i don't want to manually add each USB stick someone gives me... the usb issue stays sad

CPU Gastronomy: I think that i want to be mounting every device to /media (seems like this is the folder intended for this kind of job). I am in the storage group, as for the ls -l i get:

drwxr-xr-x 6 root root 4096 Mar 27 17:16 media.

Some update, i tried using thunar and i have the same issue (With a thunar look to it... tongue)

Offline

#5 2011-03-27 21:58:05

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: Normal user mounting permissions [SOLVED]

Try replace removing udiskie from fluxbox exec line, I'm sure you won't need it.

        fluxbox)  exec ck-launch-session dbus-launch startfluxbox ;;

Make sure you installed gamin. Try rebooting.
BTW, what login manager are you using?

Last edited by lives2evil (2011-03-27 21:58:59)


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#6 2011-03-27 21:58:18

CPU Gastronomy
Member
From: Québec, Canada
Registered: 2010-12-29
Posts: 69

Re: Normal user mounting permissions [SOLVED]

With ls -l, I wanted to see the permissions on the mounted folders, not the parent (ls -l /media).  Sorry, I've been misunderstandable.

My guess is that the volumes you want to automount are already automounted, but by root or another user (I have sometimes this problem when I use thunar as root or with another user because the permissions are set that only one user has access to it).  And when they are automounted as root (or another user), they will not automount again for your user unless you unmount them and plug them again.

EDIT : Corrected some errors.

Last edited by CPU Gastronomy (2011-03-27 21:59:16)

Offline

#7 2011-03-27 22:02:16

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Normal user mounting permissions [SOLVED]

Kalmar wrote:

along with my ntfs partitions are now being recognized (though i can't read/write

Make sure you have ntfs-3g installed.

Offline

#8 2011-03-27 22:24:02

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Re: Normal user mounting permissions [SOLVED]

I am using slim, sorry i forgot to mention that. And yes, i do have ntfs-3g, though i highly suspect that my read/write issue on my ntfs drives will vanish when i understand what's going on with the usb sticks. Gamin is installed too smile

As for my ls -l on /media i get:

dr-xr-xr-x 3 root root  296 May 16  2010 cd
drwxr-xr-x 2 root root 4096 Mar 27 16:29 dvd
drwxr-xr-x 2 root root 4096 Mar 27 16:33 fl
drwx------ 2 root root 4096 Mar 27 16:44 USB

The USB directory is not there if i remove the USB stick, and for a reason i do not fully understand, the external drive doesn't appear under /media (however it is mounted and i see it from the pcmanfm GUI)

Would changing the permission work? How would i do it for a new USB stick or something? Clearly there is something i don't understand well tongue

I also removed the udiskie from the xinitrc file (i had a feeling that i would end-up removing that line)

Last edited by Kalmar (2011-03-27 22:29:57)

Offline

#9 2011-03-27 22:35:29

I'mGeorge
Member
Registered: 2011-03-23
Posts: 150

Re: Normal user mounting permissions [SOLVED]

if I do ls -l on /mnt I get a similar response to yours but an entry for a ntfs partition mounted with fstab should look something like this

/dev/sda5    /mnt/WD_kit    ntfs-3g    defaults,locale=en_US.UTF-8    0    0

I can write read and do pretty much everything as a regular user


I've first installed Arch in March

Offline

#10 2011-03-27 22:42:08

CPU Gastronomy
Member
From: Québec, Canada
Registered: 2010-12-29
Posts: 69

Re: Normal user mounting permissions [SOLVED]

Up to now, we are guessing the problem.  Isn't there a log file for udisk and/or udiskie ?  I think that would be pretty much helpful.  If yes, it is certainly located in /var/log/.

Last edited by CPU Gastronomy (2011-03-27 22:44:34)

Offline

#11 2011-03-27 22:50:17

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Re: Normal user mounting permissions [SOLVED]

I'mGeorge, thanks, i can read/write on ntfs now.

CPU, i looked the /var/log/ and did not find a log file for udisk nor udiskie sad

Offline

#12 2011-03-27 23:10:25

I'mGeorge
Member
Registered: 2011-03-23
Posts: 150

Re: Normal user mounting permissions [SOLVED]

try something like this as root

 gpasswd -a [user] storage 

Last edited by I'mGeorge (2011-03-27 23:12:16)


I've first installed Arch in March

Offline

#13 2011-03-27 23:14:30

CPU Gastronomy
Member
From: Québec, Canada
Registered: 2010-12-29
Posts: 69

Re: Normal user mounting permissions [SOLVED]

By consulting the man page (http://sancho.ccd.uniroma2.it/cgi-bin/m … l?1+udisks), I came across two three interesting things :

--dump
    Dump all information about all devices. Please include this when filing bugs. 
--enumerate-device-files

    Lists all device files of devices know to the daemon. 

--monitor

    Connect to the daemon and print a line every time an event happens. 

--monitor-detail

    Like --monitor but prints the full details of the device whenever an event happens. 

You could use

udisks --monitor

.  Type the command and plug/unplug your usb key and check your terminal.

OR

udisks --monitor > sometextfile

That would make our log ^^.

Post the result.

EDIT : It seems that I don't know how to count to three tongue

Last edited by CPU Gastronomy (2011-03-27 23:21:04)

Offline

#14 2011-03-27 23:29:11

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Re: Normal user mounting permissions [SOLVED]

Removing and pluging the usb device generated :

removed:   /org/freedesktop/UDisks/devices/sdc1
removed:   /org/freedesktop/UDisks/devices/sdc
added:     /org/freedesktop/UDisks/devices/sdc
added:     /org/freedesktop/UDisks/devices/sdc1

I did read trough the udisks --monitor-detail but the output is LOOONG and i did not seem to figure out much sense out of it, so i wouldn't know what to paste here.

the udisks --dump was also an inifite log of text i don't understand.

I'mGeorge, i did add myself to the storage group, but i was already in the storage group sad

Offline

#15 2011-03-27 23:39:31

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: Normal user mounting permissions [SOLVED]

Did you try rebooting after changes? I have no idea what wrong anymore big_smile

Last edited by lives2evil (2011-03-27 23:54:34)


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#16 2011-03-27 23:43:07

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Re: Normal user mounting permissions [SOLVED]

Yes i do reboot between each changes tongue I «try» to avoid the obvious solutions tongue (though it probably is something very obvious that i am missing sad)

Offline

#17 2011-03-27 23:43:16

CPU Gastronomy
Member
From: Québec, Canada
Registered: 2010-12-29
Posts: 69

Re: Normal user mounting permissions [SOLVED]

Maybe a little grep could help for that (it will do some regular expression search) :

cat yourfile | grep error

EDIT : I'm speaking about the fille you generated.

Last edited by CPU Gastronomy (2011-03-27 23:44:15)

Offline

#18 2011-03-27 23:53:43

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: Normal user mounting permissions [SOLVED]

Try adding ck-launch-session to /etc/slim.conf instead of .xinitrc

login_cmd           exec ck-launch-session dbus-launch /bin/bash -login ~/.xinitrc %session

Also the content of folder /etc/polkit-1/localauthority/50-local.d/
and contents of org.freedesktop.udisks.pkla if it exist. (You won't be able to cd to that folder if you're not root).


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#19 2011-03-27 23:56:15

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Re: Normal user mounting permissions [SOLVED]

Did that, i found no error message in the file i generated. From what i understand, udisks seems to be working fine and probably mounts the usb sticks correctly. The problem is that only root can access them.

Earlier today i created permission files (according to the wiki of udiskie and pcmanfm), so that the user would have the ability to mount/unmount devices. This is the udiskie part in the directory /etc/polkit-1/localauthority/50-local.d/:

 [Local Users]
 Identity=unix-group:storage
 Action=org.freedesktop.udisks.*
 ResultAny=yes
 ResultInactive=no
 ResultActive=yes

And this is what is the other permission file i created

[Storage Permissions]
Identity=unix-group:storage
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown
ResultAny=yes
ResultActive=yes
ResultInactive=no

this last permission is named 55-myconf.pkla (again, according to the wiki).

Could these help figuring out where i got something wrong?

Offline

#20 2011-03-28 00:03:21

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: Normal user mounting permissions [SOLVED]

You won't be needing your 55-myconf.pkla file. It's the same thing as the default configuration.
Anyway, Try running "ck-launch-session dbus-launch thunar", see if it works. If it doesn't then it's not consolekit or dbus problem. Also, don't use pcmanfm from the official respository, it's falsty. Try the one from aur instead.


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#21 2011-03-28 00:03:44

Kalmar
Member
From: Québec, Canada
Registered: 2011-03-27
Posts: 10

Re: Normal user mounting permissions [SOLVED]

Alright, thank you very much for all the time smile adding the ck-launch-session and dbus-launch to the slim.conf file fixed it!

Thanks everybody again smile i'll try to mark the topic as fixed and edit my original post with the solution smile

Offline

#22 2011-03-28 00:05:26

CPU Gastronomy
Member
From: Québec, Canada
Registered: 2010-12-29
Posts: 69

Re: Normal user mounting permissions [SOLVED]

If it continues, maybe you could start all over the steps in the wiki when you've tried to install udisks.  Maybe it is simply an annoying little misconfiguration.

EDIT : Too late.  Happy to help !  Particularly if you're from Québec XD

Last edited by CPU Gastronomy (2011-03-28 00:11:20)

Offline

Board footer

Powered by FluxBB