Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Many oddities with udev and cd/dvd drives
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
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1852

PostPosted: Wed Mar 22, 2006 5:29 pm    Post subject: Many oddities with udev and cd/dvd drives Reply with quote

Wow...I've been going nuts trying to figure out what udev has been up to with my cd and dvd drives. I'm running kernel 2.6.15-gentoo-r1, and am using the 2006.0 profile. I've started out as 2005.0 and never had these issues until recently.

Up until recently, I've always used the default udev rules with no problem. Now I seem to have what appears to be random behavior.

My hdc is a dvd-rw, my hdd is a cd-rw, and I also have an exernal usb dvd-rw.

The other day I had trouble burning to several of my drives that I traced to the fact that the drives were assigned to the group 'disk' rather than 'cdrom'. The default 50-udev.rules file has the following:

Code:

ENV{ID_CDROM}=="?*",            SYMLINK+="cdrom%e", GROUP="cdrom"
ENV{ID_CDROM_CD_RW}=="?*",      SYMLINK+="cdrw%e"
ENV{ID_CDROM_DVD}=="?*",        SYMLINK+="dvd%e"
ENV{ID_CDROM_DVD_R}=="?*",      SYMLINK+="dvdrw%e"


At that time, as a test, I tried changing that to this:

Code:

ENV{ID_CDROM}=="?*",            SYMLINK+="cdrom%e", GROUP="cdrom"
ENV{ID_CDROM_CD_RW}=="?*",      SYMLINK+="cdrw%e", GROUP="cdrom"
ENV{ID_CDROM_DVD}=="?*",        SYMLINK+="dvd%e", GROUP="cdrom"
ENV{ID_CDROM_DVD_R}=="?*",      SYMLINK+="dvdrw%e", GROUP="cdrom"


And that corrected the issue, as though my dvd drives weren't being seen as CDROM devices. Here's were it gets weird...today I've replaced that with the original default 50-udev.rules and for no apparent reason, all my drives get assigned correctly to the 'cdrom' group on reboot, as though the problem never existed.

The other issue, that I've seen others run into, is that the order of the assignment of the symlinks to cd and dvd devices appears to be random. My external USB dvd-rw usually gets /dev/cdrom, though not always. In the past, my ide devices always got assigned first, so hdc was assigned to /dev/cdrom. Today I've seen it link /dev/cdrom to /dev/hdc on one reboot and to /dev/sr0 on another with the same (default) rules. On one occasion the other day after rebooting I ended up with links named dvd, dvd1, and dvd2 and they were all pointed to /dev/sr0. Really flakey stuff.

What's also odd is that the /dev/cdrom link points to /dev/sr0 rather than /dev/scd0...I could be wrong but I thought the links created at one time were to /dev/scd0.

It's all stuff I can work around, but it's very annoying. I've pretty much abandoned depending on those links and point programs to the real device paths. I know I could become a udev rules guru and probably force the link names or something...just haven't had the time. As far as the group assignment, I haven't a clue what that was all about.

Anyone else running into any of this? Thanks.

Tom
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


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

PostPosted: Sat Mar 25, 2006 4:01 pm    Post subject: Reply with quote

I haven't seen this problem.

What version of udev are you running? I know in all the latest versions I have used, the etc/udev/rules.d/50-udev.rules file entries for cdrom devices calls the /sbin/cdrom_id program and doesn't explicitally name the device and symlinks.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1852

PostPosted: Sun Mar 26, 2006 4:08 pm    Post subject: Reply with quote

I'm running the latest stable sys-fs/udev-079-r1, and the default rules file appears to be doing what you describe.

I'm now getting the proper group on all my drives. The cdrom_id program reports ID_CDROM=1 for all the drives, so I have no clue why that cdrom group assignment temporarily worked incorrectly.

The order in which drives get assigned the symlinks is a bit of a mystery though. I've pretty much given up depending on it and have various programs configured to point to the real device.

Tom
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


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

PostPosted: Sun Mar 26, 2006 4:37 pm    Post subject: Reply with quote

tld wrote:
The order in which drives get assigned the symlinks is a bit of a mystery though. I've pretty much given up depending on it and have various programs configured to point to the real device.

Tom

If they're symlinks, why does the order matter?
You can very quickly make a custom udev rule and be done with it forever if you want.
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