LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   udev permissions problems (https://www.linuxquestions.org/questions/slackware-14/udev-permissions-problems-603833/)

lyke 12-01-2007 08:32 PM

udev permissions problems
 
I tried posting this in the hardware forum, but nobody even replied...
thought I might try it here:

So my USB devices work fine - mount, unmount, eject, all of that, but to make things easier for myself, I wrote some udev rules and fstab entries for my iPod and usb flashkey - I thought that this would make Amarok a little bit easier to use (no separate umount and then eject after syncing).

The problem is that I can mount my iPod/flashkey as myself, but have to umount and eject them as superuser

here are the udev rules:

BUS=="usb", SYSFS{serial}=="****************", KERNEL=="sd?2", GROUP="users", OWNER="kyle", SYMLINK=="ipod"

BUS=="usb", SYSFS{serial}=="****************", KERNEL=="sd?1", GROUP="users", OWNER="kyle", SYMLINK=="flashkey"

*** I'm not sure if showing the serial numbers is a security issue, but a little but of paranoia is healthy

here are the fstab entries:

/dev/ipod /media/ipod auto users,noauto,rw,defaults 0 0
/dev/flashkey /media/flashkey auto users,noauto,rw,defaults 0 0

here's the error I get when I try to eject as kyle (not root)

umount: /dev/sda1: not mounted
umount: /media/flashkey: must be superuser to umount
umount: /dev/sda1: not mounted
umount: /media/flashkey: must be superuser to umount
eject: unmount of `/media/flashkey' failed

I'm running Slackware 12.0
Kernel 2.6.21.5-smp (optimized)

Thanks in advance

duryodhan 12-01-2007 09:46 PM

I am not sure as I don't have an ipod .. but your symlink and fstab only makes sure for sdb2 of ipod. Ipod actually consists of sdb1/sdb2 as well as sdb . (assuming ipod is put to sdb by udev). I think that you don't have control over sdb1/sdb , only over sdb2.

but better wait for someone who HAS an ipod to reply.

lyke 12-02-2007 08:27 AM

thats right, sdb1 is the boot partition, and never really needs to be mounted unless you want to see the firmware - this is something I do ONLY on my windows machine because all I ever need to do in sdb1 is update firmware every now and then.

I'll see what happens when I write some udev/fstab for the sdb1, and if that works I'll have to look for the second partition on my flashkey. (It shows up as both a cd-rom drive and a removable storage device in windows, but udevinfo only shows one partition... I think it has something to do with this "u3 smart" silliness)

thanks

lyke 12-02-2007 08:43 AM

That didn't work

TSquaredF 12-02-2007 09:06 AM

I don't have an ipod either, so this may be garbage, but what ARE the permissions on your device after it is mounted? If you need to, you can change them with your udev statement.
Regards,
Bill

lyke 12-03-2007 08:00 AM

ls -l /dev/ipod

lrwxrwxrwx 1 root udev 4 2007-12-04 15:02 /dev/ipod -> sda2

ls -l /media
...
drwxr-xr-x 2 root udev 4096 2006-09-25 20:50 dvd0
drwxr-xr-x 2 root udev 4096 2006-09-25 20:50 cdrom0
drwxr-xr-x 9 kyle users 16384 1969-12-31 19:00 ipod
...

TSquaredF 12-03-2007 11:02 AM

Are you sure your udev rule is being followed? It makes an "ipod" symlink, which per your last post does not exist. Your mount point permissions appear to be OK, although I wonder at the date. I would think you would be able to unmount it & have no clue why you can't.
Regards,
Bill

H_TeXMeX_H 12-03-2007 01:01 PM

Also, make sure you add yourself to the right groups (plugdev, audio, video, cdrom, floppy).

lyke 12-04-2007 02:05 PM

whoops looks like I forgot to cut and paste....

ls -l /dev/ipod
lrwxrwxrwx 1 root udev 4 2007-12-04 15:02 /dev/ipod -> sda2

I'll try adding myself to those groups, too, thanks texmex

lyke 12-04-2007 02:11 PM

mm still no go

I'm done screwing around with this, I think I'll just add myself to the sudoers file and be done with it
I can write to the ipod/flashkey just fine. It's unmounting that's the problem.

C-Sniper 12-04-2007 06:39 PM

watch out though, cause iv'e had my IPOD be on SDA2 and SDB2 as well


All times are GMT -5. The time now is 10:01 AM.