You are not logged in.

#1 2010-06-27 11:27:10

dennola4
Member
From: New Orleans, LA, USA
Registered: 2010-06-26
Posts: 10

[solved] Permissions issue - can't mount usb device as user, just root

In my last post I learned how to mount a secondary HDD from the command line.  Problem is I did it as root. Now I have xfce4 running and I need mount permissions as user.

Here's my fstab:

[dennis@archlinux media]$ cat /etc/fstab
# 
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0
/dev/sdb               /media/disk0 ext4    rw,user,noauto          0      0
/dev/sdb1              /media/disk1 ext4    rw,user,noauto          0      0
/dev/sdb3              /media/disk3 ext4    rw.user,noauto          0      0

UUID=1f813152-615e-41a1-b3e7-ce2b5b6836a5 / ext4 defaults 0 1
UUID=aba18f0f-5f37-4ab0-8241-5a271dc3dddb swap swap defaults 0 0
UUID=c4332450-df9e-4571-8256-8e1b10b4d162 /home ext4 defaults 0 1
UUID=f0a6eca0-9668-454b-b444-371566663510 /boot ext2 defaults 0 1
[dennis@archlinux media]$

....and these are the system messages I got when I plugged the device:

Unable to mount "74G Volume":
mount: only root can mount /dev/sdb3 on /media/disk3

Unable to mount "4G Volume":
mount: must be superuser to use mount

What do I do here?

.

Last edited by dennola4 (2010-06-28 00:56:51)


I'm here to learn.

Offline

#2 2010-06-27 11:57:12

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [solved] Permissions issue - can't mount usb device as user, just root

Why not use automounting instead?


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2010-06-27 12:19:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] Permissions issue - can't mount usb device as user, just root

Run 'sudo visudo' and post it here.

Offline

#4 2010-06-27 13:30:57

dennola4
Member
From: New Orleans, LA, USA
Registered: 2010-06-26
Posts: 10

Re: [solved] Permissions issue - can't mount usb device as user, just root

Karol:

# Cmnd alias specification

# Defaults specification

# Runas alias specification

# User privilege specification
root    ALL=(ALL) ALL
dennis  ALL=(ALL) ALL
%users ALL=(ALL) NOPASSWD: /usr/sbin/pppd
%users ALL=(ALL) NOPASSWD: /usr/sbin/hibernate
%users ALL=(ALL) NOPASSWD: /usr/sbin/standby

# Uncomment to allow people in group wheel to run all commands
%wheel  ALL=(ALL) ALL

# Same thing without a password
%wheel  ALL=(ALL) NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

Mr. Elendig:

Why not use automounting instead?

To install Arch packages I needed an Internet connection, which required use of a Sierra Wireless card, which required chatscripts stored on another filesystem.  In my first Arch forum post ever, the one preceding this one, I learned to mount a device by creating a mountpoint in /media then invoking #mount.  After installing all packages and creating a user name, I signed on with xfce4 and plugged in the usb device again.  It didn't mount.  So I did it manually using sudo.  Since that worked I had the idea that adding the mountpoints to /etc/fstab would be useful, so I did.  When that didn't work I decided to just ask for help.

So sure, I'm down for some automounting action.  How do I do it?


.


I'm here to learn.

Offline

#5 2010-06-27 13:45:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] Permissions issue - can't mount usb device as user, just root

Uncomment (and modify if you like)  next to last line

# Samples
%users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

You can move that line under '# User privilege specification' as you've done with your other settings.
I think you need to be in the storage group. Mine /etc/group looks like this

[karol@black ~]$ grep karol /etc/group
tty::5:karol
disk::6:root,karol
wheel::10:root,karol
log::19:root,karol
locate::21:karol
http::33:karol
network:x:90:karol
video:x:91:root,karol
audio::92:root,karol
optical::93:karol,hal
floppy:x:94:karol,hal
storage:x:95:karol,hal
users::100:karol

I have an old computer so I still have hal, but pay no attention to it.

Offline

#6 2010-06-27 14:30:20

dennola4
Member
From: New Orleans, LA, USA
Registered: 2010-06-26
Posts: 10

Re: [solved] Permissions issue - can't mount usb device as user, just root

Karol,

Using visudo I uncommented the line in /etc/sudoers:

# User privilege specification
root    ALL=(ALL) ALL
dennis  ALL=(ALL) ALL
%users ALL=(ALL) NOPASSWD: /usr/sbin/pppd
%users ALL=(ALL) NOPASSWD: /usr/sbin/hibernate
%users ALL=(ALL) NOPASSWD: /usr/sbin/standby
%users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom

# Uncomment to allow people in group wheel to run all commands
%wheel    ALL=(ALL) ALL

# Same thing without a password
%wheel    ALL=(ALL) NOPASSWD: ALL

# Samples
# %users  localhost=/sbin/shutdown -h now

I also checked to make sure that I am in group storage:

[dennis@archlinux ~]$ cat /etc/group
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin
adm:x:4:root,daemon
tty:x:5:
disk:x:6:root
lp:x:7:daemon,dennis
mem:x:8:
kmem:x:9:
wheel:x:10:root,dennis
ftp:x:11:
mail:x:12:
uucp:x:14:
log:x:19:root
locate:x:21:
rfkill:x:24:
smmsp:x:25:
http:x:33:
games:x:50:
network:x:90:
video:x:91:dennis
audio:x:92:dennis
optical:x:93:dennis,hal
floppy:x:94:dennis,hal
storage:x:95:dennis,hal
scanner:x:96:
power:x:98:dennis
nobody:x:99:
users:x:100:dennis
dbus:x:81:
dennis:x:1000:
hal:x:82:
avahi:x:84:
usbmux:x:140:
gdm:x:120:

I also have hal, obviously.......but anyhow, no dice.  :-( 

.


I'm here to learn.

Offline

#7 2010-06-27 14:57:07

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] Permissions issue - can't mount usb device as user, just root

If the only thing you need off the disk is your chatscripts, mount it (as root) and copy the scripts to /etc/ppp, or somewhere else in your installed filesystem.

/etc/fstab is not recommended for removable devices such as usb drives etc. There are various automounting options, as MrElendig suggested. and pmount is also worth considering.

Offline

#8 2010-06-27 15:06:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] Permissions issue - can't mount usb device as user, just root

+1 to tomk and MrElendig


%users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom

is for cdrom ...


Add

alias mount="sudo mount"
alias umount="sudo umount"

to your .bashrc or wherever you keep your aliases to ease mounting manually.

I use this function once in a blue moon

usm () 
{ 
    DRIVE="/dev/sdb1";
    if sudo mount | grep -q $DRIVE; then
        umount $DRIVE;
    else
        sudo mount $DRIVE /mnt/usb;
    fi
}

Last edited by karol (2010-06-27 15:20:28)

Offline

#9 2010-06-27 17:05:33

dennola4
Member
From: New Orleans, LA, USA
Registered: 2010-06-26
Posts: 10

Re: [solved] Permissions issue - can't mount usb device as user, just root

TOMK:

I initially mounted the usb device as root when first installing Arch, copied the chatscripts to /etc/ppp/peers and so forth.  The issue is that after having created a user account, NO usb devices will mount.  They do when I sign in as root, just not as user.  The mountpoints are /media/disk and /media/disk-1.  The error messages are:

  Unable to unmount "4G Volume":

Rejected send message, 1 matched rules; type="method_call", sender=":1.80" (uid=1000 pid=2915 comm="exo-unmount) interface="org.freedesktop.Hal.Device.Volume" member="Unmount" error name="(unset)" requested_reply=0 destination="org.freedesktop.Hal" (uid=0 pid=1575 comm="/usr/sbin/hald))

Unable to unmount "74G Volume":

Rejected send message, 1 matched rules; type="method_call", sender=":1.79" (uid=1000 pid=2912 comm="exo-unmount) interface="org.freedesktop.Hal.Device.Volume" member="Unmount" error name="(unset)" requested_reply=0 destination="org.freedesktop.Hal" (uid=0 pid=1575 comm="/usr/sbin/hald))

Karol:   I actually followed Tom's suggestion and got pmount, so the aliases weren't necessary.  I didn't know how to utilize the script you posted.

Geeeez, man.  I really just want my dang usb to work.  This is silly.  Thanks for continuing to support this issue.


*sigh*



Thanks for your patience.  ;-/

Last edited by dennola4 (2010-06-27 18:22:50)


I'm here to learn.

Offline

#10 2010-06-27 20:57:36

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] Permissions issue - can't mount usb device as user, just root

There's a Thunar page in the wiki - have a look there, it might be of use.

Alternatively, you could consider udev automounting, also covered in the wiki - this is independant of any DE or WM.

Offline

#11 2010-06-28 00:19:18

dennola4
Member
From: New Orleans, LA, USA
Registered: 2010-06-26
Posts: 10

Re: [solved] Permissions issue - can't mount usb device as user, just root

Huh.

I apparently overlooked the tips&tricks section of the Wiki page -- this worked perfectly.  Thanks for the help.  It's nice when Linux is friendly.

And good win at Pebble Beach.  :-)


I'm here to learn.

Offline

Board footer

Powered by FluxBB