Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
usb group? [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
quickshiftin
Guru
Guru


Joined: 27 Jul 2004
Posts: 345
Location: Denver, CO

PostPosted: Mon Nov 07, 2005 9:07 pm    Post subject: usb group? [SOLVED] Reply with quote

i have a user in the usb group. when i mount a usb device on /mnt/usb1 it looks like users have read access to the drive
Code:
rarea51 linux # ls -ld /mnt/usb1
drwxr--r--  3 root cdrom 16384 Dec 31  1969 /mnt/usb1

i can get a listing of items in the directory using ls
Code:
nathan@rarea51 ~ $ ls /mnt/usb1/
1004m.zip            IMG_1853_2.JPG   calculate.cpp                 csci1260_midterm.doc           csci1261_midterm_SOLUTION.doc  img_1853.jpg  metric.h

but cant use cd to move to the directory
Code:
nathan@rarea51 ~ $ cd /mnt/usb1/
bash: cd: /mnt/usb1/: Permission denied

this is a problem because when im viewing the filesystem via konqueror and i place /mnt/usb1 in the location bar, i only get an error saying permission denied
when i try to make the directory executable nothing happens
Code:
rarea51 linux # ls -ld /mnt/usb1
drwxr--r--  3 root cdrom 16384 Dec 31  1969 /mnt/usb1
rarea51 linux # chmod u+x /mnt/usb1 -v
mode of `/mnt/usb1' changed to 0744 (rwxr--r--)
rarea51 linux # ls -ld /mnt/usb1
drwxr--r--  3 root cdrom 16384 Dec 31  1969 /mnt/usb1

oh and one other thing, the user nathan is part of the usb group
Code:
nathan@rarea51 ~ $ groups
wheel audio cdrom cdrw usb

can someone straighten me out?? i want users to have full access to the usb mount.


Last edited by quickshiftin on Tue Nov 08, 2005 9:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
/dev/random
l33t
l33t


Joined: 26 Nov 2004
Posts: 704
Location: Austin, Texas, USA

PostPosted: Mon Nov 07, 2005 9:52 pm    Post subject: Reply with quote

Code:

chown root:usb /mnt/usb1 -R
chmod g+x /mnt/usb1 -R

Temporary fix.

Post /etc/fstab (or at least the relevant line) for a permanent fix.
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Mon Nov 07, 2005 10:59 pm    Post subject: Reply with quote

How are you mounting the device; direct fstab rules, pmount, fstab-sync, etc?

usb group will do nothing as the device group is being set to cdrom.
Either add yourself to the cdrom group or investigate why it is being set to cdrom and not usb. (Depends on your mount method)
Back to top
View user's profile Send private message
quickshiftin
Guru
Guru


Joined: 27 Jul 2004
Posts: 345
Location: Denver, CO

PostPosted: Tue Nov 08, 2005 3:39 am    Post subject: Reply with quote

Headrush wrote:
How are you mounting the device; direct fstab rules, pmount, fstab-sync, etc?
method)

Code:
#mount /dev/sda1 /mnt/usb1


hold on a bit for fstab, i have my laptop in the car...
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Tue Nov 08, 2005 6:45 am    Post subject: Reply with quote

quickshiftin wrote:
hold on a bit for fstab, i have my laptop in the car...

I've been holding for 3 hours, where did you park your car? :lol:
Back to top
View user's profile Send private message
quickshiftin
Guru
Guru


Joined: 27 Jul 2004
Posts: 345
Location: Denver, CO

PostPosted: Tue Nov 08, 2005 2:34 pm    Post subject: Reply with quote

my bad :oops: i was working on a server last night and just lost track of time. anywho, here is my fstab

Code:
/dev/hda1               /boot           ext2            noauto,noatime  1 2
/dev/hda3               /               reiserfs        noatime         0 1
/dev/hda2               none            swap            sw              0 0
/dev/hda5               /vmware         reiserfs                        0 1
/dev/hda6               /samba          reiserfs                        0 1
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro,user  0 0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/dev/sda1               /mnt/usb1       vfat            noauto, user    0 0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/dev/fd0                /mnt/floppy     auto            noauto          0 0

# NOTE: The next line is critical for boot!
proc                    /proc           proc            defaults        0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0


to reiterate, i dont mount using a line like #mount /mnt/usb1 when i do that i get the following
[mntent]: line 20 in /etc/fstab is bad
mount: can't find /mnt/usb1 in /etc/fstab or /etc/mtab

i dont know why... also though i dont think that is related to the current problem because i can mount the drive with the following line
#mount /dev/sda1 /mnt/usb1

oh yeah i think im on to something, i removed the /mnt/usb1 directory and re-created it with the following #mkdir /mnt/usb1 and ls shows the directory is associated with the cdrom group. i read the man page on mkdir and did not see a way to specify a group to associate new directories with. doesnt this have something to do with the umask setting???
EDIT: just checked up on umask and comfirmed it is just about permissions (what i thought); i still dont know how to control the default group for a directory though; still missing those basics :?
ps, i chose vfat for compatability w/ windows (referring to fstab for usb mount)
Back to top
View user's profile Send private message
/dev/random
l33t
l33t


Joined: 26 Nov 2004
Posts: 704
Location: Austin, Texas, USA

PostPosted: Tue Nov 08, 2005 8:22 pm    Post subject: Reply with quote

The error in line 20 is that you have a space after noauto,

With vfat you need something a little more verbose like:
Code:

/dev/sda1 /mnt/usb1 vfat noauto,rw,gid=usb,user,umask=0002 0 0

The rw might be redundant.
Back to top
View user's profile Send private message
quickshiftin
Guru
Guru


Joined: 27 Jul 2004
Posts: 345
Location: Denver, CO

PostPosted: Tue Nov 08, 2005 8:55 pm    Post subject: Reply with quote

Code:
rarea51 nathan # ls -ld /mnt/usb1
drwxrwxr-x  3 root usb 16384 Dec 31  1969 /mnt/usb1


everyting is in good order, and i can access the drive from konqueror 8)
the only thing i still wonder about is when creating a directory via mkdir why is the gid cdrom
what i mean is how can i specify a particular gid to associate the new directory with upon creation?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Tue Nov 08, 2005 8:58 pm    Post subject: Reply with quote

/dev/random wrote:
The error in line 20 is that you have a space after noauto,

With vfat you need something a little more verbose like:
Code:

/dev/sda1 /mnt/usb1 vfat noauto,rw,gid=usb,user,umask=0002 0 0

The rw might be redundant.

:oops: I feel so dumb, looking at the fstab listing and wondering how can there be an error on line 20 when the file isn't that long, obviously its not the complete file. doh!

quickshiftin wrote:
everyting is in good order, and i can access the drive from konqueror 8)
the only thing i still wonder about is when creating a directory via mkdir why is the gid cdrom
what i mean is how can i specify a particular gid to associate the new directory with upon creation?

I think by default it makes the group depending on the main group the user is.
(There are exceptions based on parent directory.)
Back to top
View user's profile Send private message
quickshiftin
Guru
Guru


Joined: 27 Jul 2004
Posts: 345
Location: Denver, CO

PostPosted: Tue Nov 08, 2005 9:16 pm    Post subject: Reply with quote

this entire conversation has sparked a solution to another problem i was having along the same vein. not being able to have a user (besides root of course) access a samba mount. what i now need to know is can a specify mounting of a virtual file system (smbfs) in fstab? i was thinkning if i couldnt do that i could just map the specific mount command i typically use to an alias in bash.rc, especially considering the vfs isnt ready to mount until samba is running anyway?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Tue Nov 08, 2005 9:30 pm    Post subject: Reply with quote

quickshiftin wrote:
what i now need to know is can a specify mounting of a virtual file system (smbfs) in fstab?

Yes. Something like:
Code:
//192.168.1.1/sharename     /mountpoint   smbfs   rw     0   0


Although I don't have a lot of samba experience, I have heard of a lot of trouble if you haves spaces in the samba share name.

Edit: I guess for spaces, they have to be escaped like this:
Code:
//192.168.1.1/sharename\040With\040Space

You'll have to check the man pages for all the options you can use in /etc/fstab for samba shares.
Back to top
View user's profile Send private message
quickshiftin
Guru
Guru


Joined: 27 Jul 2004
Posts: 345
Location: Denver, CO

PostPosted: Tue Nov 08, 2005 9:45 pm    Post subject: Reply with quote

it works. i thought to do the same syntax and was getting the classic
Code:
rarea51 nathan # mount /mnt/smbShare/
[mntent]: line 19 in /etc/fstab is bad
mount: can't find /mnt/smbShare in /etc/fstab or /etc/mtab

only to realize i had a , in between the last 2 0's on the line!

well thanks, ive learned a lot (that i need to read the mount manpage for starters) and have my system more dialed than before. now i dont have to do some of the mundane mounting i always do when i start the laptop every morning, and i can work with cut and paste in konqueror!
Back to top
View user's profile Send private message
/dev/random
l33t
l33t


Joined: 26 Nov 2004
Posts: 704
Location: Austin, Texas, USA

PostPosted: Wed Nov 09, 2005 12:36 am    Post subject: Reply with quote

You can change what group the user is working as, but I don't remember what the command is.
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