LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 10.1 + Udev Permissions and USB Drives (https://www.linuxquestions.org/questions/slackware-14/slackware-10-1-udev-permissions-and-usb-drives-292260/)

rignes 02-19-2005 09:34 AM

Slackware 10.1 + Udev Permissions and USB Drives
 
I've gotten udev working in Slackware 10.1 and it works great except for two little annoyances.

1) I can't seem to find a howto that covers modifying device permissions. I would like to change my /dev/hdc from 660 to 666 because it is a CD-RW. I could just use groups to solve it, but the point is I don't know how to change the permission udev assigns and I'd like to learn. Anyone know of a good howto?

2) I have a USB external drive that I created a rule for, it get's assigned to ub?1 and has a symlink called pendrive that points to ub?1. This works perfectly except for on bootup. I have an entry in my fstab to mount /dev/pendrive into /mnt/pendrive.

The problem is, during boot it seems that udev hasn't taken care of the usb drive yet when it gets to mounting the partitions in fstab. If I login and then run mount -a as root it mounts the drive fine. I stuck mount -a in my rc.local but that seems like a cheesy fix.

Google hasn't been super helpful on these for some reason. :/

Any help is appreciated.

Thanks.

Andrew Benton 02-19-2005 09:54 AM

To change the permissions udev assigns edit /etc/udev/permissions.d/udev.permissions and change
Code:

# disk devices
hd*:root:disk:660

to
Code:

# disk devices
hdc:root:disk:666
hd*:root:disk:660

For the second problem, with the USB flash memory, the problem is that udev doesn't create the node in /dev until slightly after the module is inserted into the kernel. If you can load the ub module before udev is run it should solve the problem. The best way to fix that issue would be to build the ub driver into the kernel, then udev will create the node in /dev on boot.

rignes 02-21-2005 07:38 PM

Actually, tried exactly that in udev.permissions and it didn't work. However, in udev.rules there is a line at the top of the file that deals with cdroms like this:

Code:

BUS="ide", KERNEL="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom*", NAME="%k", GROUP="cdrom", MODE="0660"
I changed the MODE to "0666" and it worked just as I intended. I presume the MODE key in the rules file takes precedence over the permissions file.

You suggestion for the USB drive worked. I removed the ub driver since it claims to cripple usb_storage so now my drive shows up as sdx like it used to. Then I just used rc.modules to modprobe the proper module in on boot.

Thanks for the help.

MMYoung 03-07-2005 09:12 PM

What version of udev are you using? If it's 0.54 there are some problems with the permissions in that version. Most reports I've seen say that switching back to udev 0.50 fixes it.

Also, if it was me, I'd DITCH ub and use the standard usb-storage. But that's just me.

Later,
MMYoung


All times are GMT -5. The time now is 01:40 PM.