You are not logged in.

#1 2006-03-06 05:20:19

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

udev and my external cd rw device

I see that my /dev/sg0, /dev/sg1, /dev/sg2 are created on each boot with their group as root. However, my /etc/udev/rules.d/udev.rules has these lines in it:

# permissions for SCSI CD devices
BUS=="scsi", KERNEL=="sr[0-9]*", SYSFS{type}=="5", NAME="scd%n",GROUP="optical"
BUS=="scsi", KERNEL=="sg[0-9]*", SYSFS{type}=="5", NAME="%k", GROUP="optical"

What might I be doing wrong here? The first time after each boot that I run kb3, I have to manually set the group for these devices to optical so I can write to a CD.

Offline

#2 2006-03-06 08:08:47

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: udev and my external cd rw device

what type does your /sys report on these devices?

Offline

#3 2006-03-06 14:59:42

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

tpowa wrote:

what type does your /sys report on these devices?

How do I find that info? I do know that this used to work fine with Arch, and don't remember which upgrade caused this problem.

Offline

#4 2006-03-06 15:02:11

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

tpowa wrote:

what type does your /sys report on these devices?

Oh, I think this is what you want. Here's a line from dmesg:

sr 3:0:0:0: Attached scsi generic sg3 type 5
sd 2:0:6:0: Attached scsi generic sg2 type 0

Offline

#5 2006-03-06 15:20:05

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: udev and my external cd rw device

what modules are loaded?
sr_mod and sg?

Offline

#6 2006-03-06 15:28:43

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

tpowa wrote:

what modules are loaded?
sr_mod and sg?

Both of those are loaded.

Offline

#7 2006-03-06 15:49:50

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: udev and my external cd rw device

what does udevtest /block/<yourdevicenode> show?

Offline

#8 2006-03-06 15:53:09

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

tpowa wrote:

what does udevtest /block/<yourdevicenode> show?

I'll have to test this when I get back from the office. For now I rely on rc.local to reset the groups for those devices.

How do I determine my device node?

Offline

#9 2006-03-06 15:58:52

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: udev and my external cd rw device

well i don't know how they are called, i guess it's sr or something like that.
check if it's listed in /sys/block
then use my command, it will show you what udev does to that node.

Offline

#10 2006-03-07 01:01:21

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

I have no idea what I'm looking at in

/sys/block/sr0

Nothing there that sounds like a node or a device node. My rc.local should do the trick for me for now, though.

Offline

#11 2006-03-07 06:45:20

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: udev and my external cd rw device

i mean is there /sys/block/sr0?
if yes run udevtest /block/sr0
then you get all invfo from udev what it does to the node.

Offline

#12 2006-03-07 07:17:58

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

Okay. Here goes:

[ralvy@tux ~]$ udevtest /block/sr0
main: looking at device '/block/sr0' from subsystem 'block'
udev_make_node: mknod(/dev/.tmp-11-0, 060600, 11, 0) failed: Permission denied
run_program: '/sbin/cdrom_id --export /dev/.tmp-11-0'
run_program: '/sbin/cdrom_id' returned with status 1
udev_rules_get_name: rule applied, 'sr0' becomes 'scd0'
unlink_secure: chown(/dev/.tmp-11-0, 0, 0) failed: No such file or directory
unlink_secure: chmod(/dev/.tmp-11-0, 0000) failed: No such file or directory
create_node: creating device node '/dev/scd0', major = '11', minor = '0', mode = '0660', uid = '0', gid = '93'
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: '/lib/udev/cdsymlinks.sh'
main: run: 'socket:/org/kernel/udev/monitor'

Offline

#13 2006-03-07 07:22:00

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: udev and my external cd rw device

ok your device is scd and has correct permissions on optical, gid=93

Offline

#14 2006-03-07 07:34:30

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

tpowa wrote:

ok your device is scd and has correct permissions on optical, gid=93

Hmmm...but when I run k3b, and ask it to burn a CD, and I don't have sg[0-3] set to gid=93, I'm told

cdrecord has no permissions to open the device

If I then set those devices to gid=93, k3b stops complaining and writes the image. So scd having gid=93 is never enough by itself.

Offline

#15 2006-03-07 07:48:34

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: udev and my external cd rw device

then do the same for sg device run udevtest on it it will tell you more.

Offline

#16 2006-03-07 14:34:40

ralvy
Member
From: Santa Monica, California
Registered: 2004-12-06
Posts: 275

Re: udev and my external cd rw device

Well, that's what's odd. There's no sg device in /sys/block. I think this is beyond me. For now, using rc.local to reset sg[0-2] permissions to gid=93 works okay. Arch seems to set sg3 to gid=93 without my having to change it with rc.local.

Offline

Board footer

Powered by FluxBB