You are not logged in.

#1 2007-11-04 12:56:06

voodoo.child
Member
Registered: 2007-11-01
Posts: 30

usb drive mount by a normal user

how can i make a normal user mount usb drives? i added a line in fstab that allows users to mount /dev/sdb1, but this solves only partially the problem


--
Alexandru

Offline

#2 2007-11-04 14:54:26

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: usb drive mount by a normal user

Ye. I'm also interested in that... I never wanted to mount usb drive like a normal user, but I have other problem: My user has a readonly access to the usb stick.


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#3 2007-11-04 15:00:26

mico
Member
From: Slovenia
Registered: 2004-02-08
Posts: 247

Re: usb drive mount by a normal user

voodoo.child wrote:

how can i make a normal user mount usb drives? i added a line in fstab that allows users to mount /dev/sdb1, but this solves only partially the problem

You could remove corresponding entry in fstab and use pmount and pumount instead of mount/umount.

Last edited by mico (2007-11-04 15:02:34)

Offline

#4 2007-11-04 15:56:15

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: usb drive mount by a normal user

Have you read the beginners guide?
So far, you've told us next to nothing about your system and setup, so here's a rather lacking answer in return. Ask smart questions.


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#5 2007-11-04 20:00:36

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: usb drive mount by a normal user

try adding the user to the storage group .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#6 2007-12-01 17:39:39

tousborne
Member
Registered: 2007-12-01
Posts: 5

Re: usb drive mount by a normal user

After a recent sys upgrade, I am having a somewhat similar problem.  I can still mount my usb stick, but the permissions are now a little screwy (EDIT: i.e. permission denied when trying to change into /mnt/usb directory).

fstab entry:

/dev/sdc1   /mnt/usb  vfat  rw,user,noauto     0  0

after performing a mount /mnt/usb the permissions on /mnt are:

d-wxrw-rwx 6 root users 16384 1969-12-31 19:00 usb

well, the permissions on this drive seem strange to me, as well as the 1969 date.  Additionally if I look at the directory as root everything is executable, which should not be the case.  I've added my username to users and storage in /etc/groups to no effect.  I can mount fine using pmount, but I would much prefer things my way, plus i dislike the idea of being forced to mount things under /media (notions of liberty and such)

Any thoughts or additional info needed?  I've become stumped enough by this odd behavior to actually register and post.

Last edited by tousborne (2007-12-01 17:42:08)

Offline

#7 2007-12-01 18:11:40

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: usb drive mount by a normal user

man mount, section on fat, uid/gid/dmask/fmask options.


1000

Offline

#8 2007-12-01 20:02:55

tousborne
Member
Registered: 2007-12-01
Posts: 5

Re: usb drive mount by a normal user

wow, I feel foolish.  I didn't even think of editing ID/mask options.  So for anyone that reads this thread in the future the correction i needed was just a minor edit to /etc/fstab:

/dev/sdc1    /mnt/usb   vfat     rw,user,noauto,uid=500,gid=500    0  0

where the uid and gid are specific to the user that needs permission.  Also, some might need to add a fmask=*** or dmask=*** where the *** represents the permissions octect for the files/directory (i.e. if you're feeling adventurous and risky 777 (not recommended)) but in my case permissions were set fine by the calling process.

Sidenote: Anyone know why this would have changed on a recent update?  Previously I had not needed to set permission IDs in fstab.  (my logs indicate an update to pam and udev could they be the cause?)

Offline

#9 2007-12-01 20:11:29

jordi
Member
Registered: 2006-12-16
Posts: 103
Website

Re: usb drive mount by a normal user

you might want to take a look at pmount instead of messing around with fstab entries...

Last edited by jordi (2007-12-01 20:11:55)

Offline

#10 2007-12-03 15:18:10

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: usb drive mount by a normal user

you don't need (should not) specify filesystem.
If you have several usb devices connected at the same time, and you need static mounting point (or WM does not handle dynamic device creation), this is mine fstab (different distros) entry for usb:

/dev/sdb1 /mnt/usb1 auto noauto,user,rw 0 0
/dev/sdb2 /mnt/usb2 auto noauto,user,rw 0 0
/dev/sdb3 /mnt/usb3 auto noauto,user,rw 0 0

also you may try ivman that will work nicely with different WMs and will be able to mount removable devices per user with all required rights granted.

Offline

#11 2007-12-03 16:46:04

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: usb drive mount by a normal user

what happened to using hal and dbus to autoload devices?


Mr Green

Offline

#12 2007-12-03 18:54:27

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: usb drive mount by a normal user

if you want to have static mount point for each of usb ports, then you must define mount points.
Otherwise you don't have to specify anything in fstab to mount usb device obviously, but you would need mounting mechanism that will mount device with user privileges (that is the point). KDE/Gnome have this, blackbox does not so you can consider to use ivman or similar.

Last edited by broch (2007-12-03 18:59:24)

Offline

#13 2007-12-04 22:28:28

tousborne
Member
Registered: 2007-12-01
Posts: 5

Re: usb drive mount by a normal user

Using auto (in fstab) to determine the FS somehow cleared all permissions issues.  Personally, I think that is very strange, especially considering I had previously specified the FS as vfat using same mountpoint and usb stick for over 1.5 years with no issue, until a recent update.  But hey, it works now and that's good enough for me.  HAL and dbus seem interesting, but I don't think they are "integrated" into xmonad (not sure about that) and don't think they really should be.

By the way, if it wasn't for being forced into mounting into /media and/or if they supported loop mounts, pmount would be really cool.

Also, ivman looks interesting, I don't really have a use for it as I only ever mount my usb stick or ipod so static mounting isn't an issue.  But, as it looks cool, I'm going to check it out, out of curiosity.

Last edited by tousborne (2007-12-04 22:29:18)

Offline

Board footer

Powered by FluxBB