Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev - mount question [solved]
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
salmonix
Guru
Guru


Joined: 16 Jul 2006
Posts: 410

PostPosted: Tue Sep 08, 2009 10:08 am    Post subject: udev - mount question [solved] Reply with quote

Hi there,
maybe silly question but... I have an udev rule to create a /dev symlink and set ownership for a particular
pendrive. Now, I would like to allow owner to mount that nod in his home. Unfortunately mount /dev/oldpendrive
/home/salmonix/pendrive does not work - permission denied, saying:
Quote:

salmonix@darkstar ~ $ mount /dev/oldpendrive pendrive/
mount: permission denied. (are you root?)


The udev rule:
Quote:

KERNEL=="sdb" SUBSYSTEM=="block" SUBSYSTEMS=="usb" ATTRS{serial}=="106C113C3AED89A5" OWNER="salmonix" SYMLINK+="oldpendrive"


It works - permissions for the /dev symlink:
Quote:
getfacl: Removing leading '/' from absolute path names
# file: dev/oldpendrive
# owner: salmonix
# group: disk
user::rw-
group::r--
other::---


Where I'd like to end up is to add a RUN+="somescript" rule to the rule created and that script would mount the device in the owner's home somewhere with r/w permissions, of course. But for the time if owner can mount the device does is.
_________________
Quis custodiet ipsos, custodes?


Last edited by salmonix on Sat Sep 12, 2009 6:54 am; edited 1 time in total
Back to top
View user's profile Send private message
vad3r
Guru
Guru


Joined: 02 May 2004
Posts: 461
Location: Munich, Germany

PostPosted: Wed Sep 09, 2009 4:42 pm    Post subject: Reply with quote

You have to add your device and mount path to /etc/fstab. Specify the option "user" and non-root users can mount it.
_________________
-- http://www.linuxaddicted.de/ | Please help to answer open questions
Back to top
View user's profile Send private message
salmonix
Guru
Guru


Joined: 16 Jul 2006
Posts: 410

PostPosted: Thu Sep 10, 2009 6:47 am    Post subject: Reply with quote

It does not work - I have tried it. (Or missed sq...)

in fstab:
Quote:
/dev/oldpendrive /home/salmonix/pendrive auto rw,user,noauto 0 0


But:
Quote:

salmonix@darkstar ~ $ mount /dev/oldpendrive pendrive/
mount: permission denied. (are you root?)
salmonix@darkstar ~ $

_________________
Quis custodiet ipsos, custodes?
Back to top
View user's profile Send private message
vad3r
Guru
Guru


Joined: 02 May 2004
Posts: 461
Location: Munich, Germany

PostPosted: Thu Sep 10, 2009 9:30 am    Post subject: Reply with quote

Wrong mount command. Try this:

Code:
mount /home/salmonix/pendrive

_________________
-- http://www.linuxaddicted.de/ | Please help to answer open questions
Back to top
View user's profile Send private message
salmonix
Guru
Guru


Joined: 16 Jul 2006
Posts: 410

PostPosted: Thu Sep 10, 2009 11:48 am    Post subject: Reply with quote

Nop.
Variants:
Quote:
salmonix@darkstar ~ $ mount /dev/oldpendrive
mount: permission denied. (are you root?)
salmonix@darkstar ~ $ mount /home/salmonix/pendrive/
mount: permission denied. (are you root?)
salmonix@darkstar ~ $ mount /dev/oldpendrive /home/s
salmonix/ syncpkgd/
salmonix@darkstar ~ $ mount /dev/oldpendrive /home/salmonix/pendrive/
mount: permission denied. (are you root?)
salmonix@darkstar ~ $

_________________
Quis custodiet ipsos, custodes?
Back to top
View user's profile Send private message
vad3r
Guru
Guru


Joined: 02 May 2004
Posts: 461
Location: Munich, Germany

PostPosted: Thu Sep 10, 2009 12:12 pm    Post subject: Reply with quote

Strange. The only thing else i can think of are permission problems on your device. Should be sufficient as far as i see but try to be a little more restrictive (group +w, ...)
_________________
-- http://www.linuxaddicted.de/ | Please help to answer open questions
Back to top
View user's profile Send private message
salmonix
Guru
Guru


Joined: 16 Jul 2006
Posts: 410

PostPosted: Fri Sep 11, 2009 7:44 am    Post subject: Reply with quote

Maybe devil inside...

I have changed fstab entry putting the 'owner' option in the line instead of users. Nop.
Strange, mount has these permissions:
Quote:
salmonix@darkstar ~ $ getfacl /bin/mount
getfacl: Removing leading '/' from absolute path names
# file: bin/mount
# owner: root
# group: root
user::rwx
group::--x
other::--x


I have checked if busybox aliases act behind the scenes - but not.
_________________
Quis custodiet ipsos, custodes?
Back to top
View user's profile Send private message
salmonix
Guru
Guru


Joined: 16 Jul 2006
Posts: 410

PostPosted: Sat Sep 12, 2009 6:53 am    Post subject: Reply with quote

Yeah, detail. I had to sync the permissions in fstab (adding owner option) and the device file permissions.
Those mismatched and escaped my attention.
I have realized that the settings work the next start of the box.
_________________
Quis custodiet ipsos, custodes?
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