Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] mount usb only works as root
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
c707176
Apprentice
Apprentice


Joined: 01 Mar 2005
Posts: 215

PostPosted: Sun Mar 18, 2007 3:26 pm    Post subject: [solved] mount usb only works as root Reply with quote

Hi,

I followed the USB howto guide and got my USB storage device working. However, I can only mount it as root which is not so nice although I included the user flag to fstab:

/dev/cdrom /mnt/cdrom iso9660 noauto,ro,user 0 0
/dev/sdb1/ /mnt/usb auto noauto,user,rw,sync 0 0

I have the same problem with mounting the cdrom:

mount /dev/cdrom /mnt/cdrom
mount: only root can do that

Is there anything missing?


Last edited by c707176 on Sun Apr 01, 2007 6:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
suicidal_orange_II
Apprentice
Apprentice


Joined: 04 Sep 2004
Posts: 299

PostPosted: Sun Mar 18, 2007 3:45 pm    Post subject: Reply with quote

In a word - Yes :)

By giving mount 2 arguements (/dev/cdrom and /mnt/cdrom) it bypasses fstab. Using either on its own mount will look in fstab and match the other one, and read the fact user is in the flags so allow non root to mount


Suicidal_Orange
Back to top
View user's profile Send private message
c707176
Apprentice
Apprentice


Joined: 01 Mar 2005
Posts: 215

PostPosted: Thu Mar 29, 2007 4:51 pm    Post subject: Reply with quote

Hello,

thanks for your remark. However, mounting the usb as a user fails:

mount /mnt/usb
mount: special device /dev/sdb/ does not exist
(a path prefix is not a directory)

Any ideas?
Back to top
View user's profile Send private message
jmbargar
n00b
n00b


Joined: 24 Mar 2007
Posts: 17
Location: Spain

PostPosted: Fri Mar 30, 2007 10:24 am    Post subject: Reply with quote

First of all, you have to delete the last slash that you have at the end of /dev/sdb1/ in the fstab file, so you would have to put /dev/sdb1 instead of /dev/sdb1/

After that, you would have to have created the folder that you have defined in /etc/fstab, in your case you would have done from a root terminal the follow:

Code:
mkdir /mnt/usb


At last, you have to grant permissions for mounting your usb device in the path specified in the fstab. Try to do the follow from a root terminal:

Code:
chmod 777 /mnt/usb


now try to mount the usb device from your user account.
_________________
J. Manuel Barrios
Back to top
View user's profile Send private message
Ehnvis
Guru
Guru


Joined: 13 Jun 2006
Posts: 305
Location: /dev/random

PostPosted: Fri Mar 30, 2007 11:37 am    Post subject: Reply with quote

Do your user belong to the cdrom and usb groups? If not you have to add the user to those groups.

And there is no need to change permissions to the directory like jmbargar says, i've never needed to change that anyway.
_________________
HP NC 4010, Pentium-M 725 1.6GHz w/ 1Gb RAM, 60Gb Hitachi Travelstar.
Running Gentoo-2.6.21-r4 (again as 2.6.22 kernels hogs CPU), all but SD reader works fine.
Back to top
View user's profile Send private message
jmbargar
n00b
n00b


Joined: 24 Mar 2007
Posts: 17
Location: Spain

PostPosted: Fri Mar 30, 2007 1:42 pm    Post subject: Reply with quote

The Ehnvis option is valid as well, you have to do all I have said you, but if you don't want to change permissions you can add your user to usb group opening a root terminal and writting something like the follow:

Code:
gpasswd -a user group


where group must be "usb".

You can check that you have done all right opening a user terminal and writting:

Code:
groups


in the output you must see that you have been added to the usb group correctly.

You have to do the same for mounting your cd from your user account. Only change the /mnt/cdrom permissions or add your user to the cdrom group like I have explained you with usb devices.
_________________
J. Manuel Barrios
Back to top
View user's profile Send private message
lonrot_m
Apprentice
Apprentice


Joined: 18 Jun 2005
Posts: 274
Location: Mexico

PostPosted: Fri Mar 30, 2007 2:32 pm    Post subject: Reply with quote

I think the best way to do this is modifying your udev rules to your usb.
_________________
The only fool bigger than the person who knows it all is the person who argues with him.
Back to top
View user's profile Send private message
c707176
Apprentice
Apprentice


Joined: 01 Mar 2005
Posts: 215

PostPosted: Sun Apr 01, 2007 6:03 pm    Post subject: [solved] mount usb only works as root Reply with quote

Thanks for your hints! It works now!
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