Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172592 - sys-fs/udev-104 - external CD/DVD USB 2.0 drive /dev symlinks breaks internal CD/DVD IDE drives /dev symlinks.
Summary: sys-fs/udev-104 - external CD/DVD USB 2.0 drive /dev symlinks breaks internal...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-28 20:21 UTC by Francisco Lloret
Modified: 2007-03-31 10:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francisco Lloret 2007-03-28 20:21:04 UTC
In my PC have three optical drives: two IDE internal (a DVD-ROM hdc and a CD-RW hdd) and one external (DVD-RW) using a firewire connection.

I boot the system with the external DVD-RW unpowered, and then the /dev symlinks are:

$ ls /dev/cd* -ld
lrwxrwxrwx 1 root root 3 mar 28 17:49 /dev/cdrom -> hdc
lrwxrwxrwx 1 root root 3 mar 28 17:49 /dev/cdrom1 -> hdd
lrwxrwxrwx 1 root root 3 mar 28 17:49 /dev/cdrw1 -> hdd
$ ls /dev/dv* -ld
drwxr-xr-x 3 root root 60 mar 28 17:49 /dev/dvb
lrwxrwxrwx 1 root root  3 mar 28 17:49 /dev/dvd -> hdc

After connecting the external drive:

$ ls /dev/cd* -ld
lrwxrwxrwx 1 root root 3 mar 28 22:03 /dev/cdrom -> sr0
lrwxrwxrwx 1 root root 3 mar 28 17:49 /dev/cdrom1 -> hdd
lrwxrwxrwx 1 root root 3 mar 28 22:03 /dev/cdrw -> sr0
lrwxrwxrwx 1 root root 3 mar 28 17:49 /dev/cdrw1 -> hdd
$ ls /dev/dv* -ld
drwxr-xr-x 3 root root 60 mar 28 17:49 /dev/dvb
lrwxrwxrwx 1 root root  3 mar 28 22:03 /dev/dvd -> sr0
lrwxrwxrwx 1 root root  3 mar 28 22:03 /dev/dvdrw -> sr0

The symlinks to hdc are missing. Then i disconnect the external drive, and the result is:

$ ls /dev/cd* -ld
lrwxrwxrwx 1 root root 3 mar 28 17:49 /dev/cdrom1 -> hdd
lrwxrwxrwx 1 root root 3 mar 28 17:49 /dev/cdrw1 -> hdd
$ ls /dev/dv* -ld
drwxr-xr-x 3 root root 60 mar 28 17:49 /dev/dvb

The only internal drive accessible is hdd

The udev version is 104-r2. Hotplug and Coldplug aren't installed.

Reproducible: Always

Steps to Reproduce:
1.Install two internal drives in a computer
2.Connect an external drive and then unconnect it
3.See the symlinks in /dev



Expected Results:  
External drive don't have to modify internal drive symlinks
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-03-28 20:33:40 UTC
Reopen if you can reproduce w/ udev-107 (make sure that you have no orphaned/stale junk in /etc/udev/rules.d and that you've run etc-update properly).
Comment 2 Francisco Lloret 2007-03-29 18:47:05 UTC
After a few changes:

-Deleted old /etc/udev/scripts directory
-udev updated to last portage version (108)

the issue is only partialy solved. Now:

At the beginning i have:

$ ls -ld /dev/cd*
lrwxrwxrwx 1 root root 3 2007-03-29 20:33 /dev/cdrom -> hdc
lrwxrwxrwx 1 root root 3 2007-03-29 20:32 /dev/cdrom1 -> hdd
lrwxrwxrwx 1 root root 3 2007-03-29 20:32 /dev/cdrw1 -> hdd
$ ls -ld /dev/dv*
drwxr-xr-x 3 root root 60 2007-03-29 20:32 /dev/dvb
lrwxrwxrwx 1 root root  3 2007-03-29 20:33 /dev/dvd -> hdc
$

I connect the external drive, and then:

$ ls -ld /dev/cd*
lrwxrwxrwx 1 root root 3 2007-03-29 20:35 /dev/cdrom -> sr0
lrwxrwxrwx 1 root root 3 2007-03-29 20:32 /dev/cdrom1 -> hdd
lrwxrwxrwx 1 root root 3 2007-03-29 20:35 /dev/cdrw -> sr0
lrwxrwxrwx 1 root root 3 2007-03-29 20:32 /dev/cdrw1 -> hdd
$ ls -ld /dev/dv*
drwxr-xr-x 3 root root 60 2007-03-29 20:32 /dev/dvb
lrwxrwxrwx 1 root root  3 2007-03-29 20:35 /dev/dvd -> sr0
lrwxrwxrwx 1 root root  3 2007-03-29 20:35 /dev/dvdrw -> sr0
$

Same problem: hdc symlinks are missing, but, if i disconnect the external drive, then...

$ ls -ld /dev/cd*
lrwxrwxrwx 1 root root 3 2007-03-29 20:36 /dev/cdrom -> hdc
lrwxrwxrwx 1 root root 3 2007-03-29 20:32 /dev/cdrom1 -> hdd
lrwxrwxrwx 1 root root 3 2007-03-29 20:32 /dev/cdrw1 -> hdd
$ ls -ld /dev/dv*
drwxr-xr-x 3 root root 60 2007-03-29 20:32 /dev/dvb
lrwxrwxrwx 1 root root  3 2007-03-29 20:36 /dev/dvd -> hdc
$

hdc re-appears!!! But, why is unavailable when external drive is connected?
Comment 3 Francisco Lloret 2007-03-29 19:01:34 UTC
Of course, i executed etc-update after udev update, and all the files in /etc/udev/rules.d are files installed with the udev emerge (i don't modify this files), and two aditional files: 99-libsane.rules (don't does anything with CD/DVD drives, i supose this file is installed by sane) and my own file 20-mis.udev.rules that i use for externals units (is the only file hand-modified by me) with this content:

$ cat 20-mis.udev.rules
# Link permanente para el ZIP
KERNEL=="sd[a-z]4", SYSFS{model}=="ZIP 100         ", SYMLINK+="disk/zip100"

# Para el lector HAMA
KERNEL=="sd[a-z]1", SYSFS{model}=="SD  Card Reader ", SYMLINK+="disk/sd-reader"
KERNEL=="sd[a-z]1", SYSFS{model}=="MS  Card Reader ", SYMLINK+="disk/ms-reader"

# Para el MP3
KERNEL=="sd[a-z]1", SYSFS{model}=="Audio Player    ", SYMLINK+="disk/mp3"

# Para el disco duro externo

KERNEL=="sd*", SYSFS{vendor}=="ST380011", SYMLINK+="disk/externo%n"

that don't does anything with CD drives. The entire /etc/udev/rules.d directory is:

$ ls -l
total 120
-rw-r--r-- 1 root root   592 mar 29 20:29 05-udev-early.rules
-rw-r--r-- 1 root root   478 feb 11 11:34 20-mis.udev.rules
-rw-r--r-- 1 root root    55 oct 13 13:29 30-svgalib.rules
-rw-r--r-- 1 root root 10710 mar 29 20:29 50-udev.rules
-rw-r--r-- 1 root root  1303 mar 29 20:29 60-persistent-input.rules
-rw-r--r-- 1 root root  3762 mar 29 20:29 60-persistent-storage.rules
-rw-r--r-- 1 root root  1264 mar 29 20:29 64-device-mapper.rules
-rw-r--r-- 1 root root  1542 feb 17 17:18 70-persistent-cd.rules
-rw-r--r-- 1 root root   490 feb 17 14:58 70-persistent-net.rules
-rw-r--r-- 1 root root   186 mar 29 20:29 75-cd-aliases-generator.rules
-rw-r--r-- 1 root root   839 mar 29 20:29 75-persistent-net-generator.rules
-rw-r--r-- 1 root root   186 feb 20 21:39 90-hal.rules
-rw-r--r-- 1 root root   700 mar 29 20:29 95-udev-late.rules
-rw-r--r-- 1 root root 61163 nov 26 19:21 99-libsane.rules
Comment 4 Matthias Schwarzott gentoo-dev 2007-03-29 19:31:15 UTC
Please also attach the content of 70-persistent-cd.rules
Comment 5 Matthias Schwarzott gentoo-dev 2007-03-30 06:57:20 UTC
My guess is that you have two or more lines in 70-persistent-cd.rules that point to /dev/cdrom.
Comment 6 Francisco Lloret 2007-03-30 12:24:08 UTC
$ cat 70-persistent-cd.rules
# uPD720133 (pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"
# DVD-ROM_DDU1621 (pci-0000:00:09.0-ide-1:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:09.0-ide-1:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:09.0-ide-1:0", SYMLINK+="dvd", ENV{GENERATED}="1"
# PLEXTOR_CD-R_PX-W5224A (pci-0000:00:09.0-ide-1:1)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:09.0-ide-1:1", SYMLINK+="cdrom1", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:09.0-ide-1:1", SYMLINK+="cdrw1", ENV{GENERATED}="1"
# uPD720133 (pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK+="cdrom2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK+="cdrw2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK+="dvd2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK+="dvdrw2", ENV{GENERATED}="1"
$

Litle CORRECTION: the external DVD-RW drive is USB 2.0, not Firewire. the Firewire unit is the external hard disk. Sorry for the confusion.
Comment 7 Francisco Lloret 2007-03-30 12:28:02 UTC
Note: the 70-persistent-cd.rules was automaticaly generated. I don't modified it by hand.
Comment 8 Matthias Schwarzott gentoo-dev 2007-03-30 12:34:00 UTC
# uPD720133 (pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0",
SYMLINK+="cdrom", ENV{GENERATED}="1"
[...]
# DVD-ROM_DDU1621 (pci-0000:00:09.0-ide-1:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:09.0-ide-1:0",
SYMLINK+="cdrom", ENV{GENERATED}="1"

As you can see there are two rules generating the cdrom symlink.
Best solution is to just delete this file, and let udev recreate it.
By either rebooting, or calling udevtrigger.
Comment 9 Francisco Lloret 2007-03-30 16:23:37 UTC
Thanks.

In the original 70-persistent-cd.rules, deleting (with the external dvd-rw disconnected) all the info except the for the two internal drives solves the problem: when i connect the dvd-rw external drive, udev adds the corresponding lines in this file, end then it works ok.

I made a backup copy of the file in /root.

I delete it from /etc/udev/rules.d and then power-off the system, when i boot up the system, and after entering X i connect the external drive, the /etc/udev/rules.d/70-persistent-cd.rules file only contains info for the external drive, and don't works ok. Then, i run udevtrigger and it adds entries for the two internal drives, but the drives order in inverted. Deleting the file, running then udevtrigger with the external drive disconnected and then connecting the dvd-rw drive, then works i want: cdrom and dvd symlinks for DVD-ROM internal drive, cdrom1 and cdrw1 symlinks for the CD-RW internal drive, and cdrom2, cdrw2, dvd2 and dvdrw2 symlinks for the external dvd-rw drive.

Is curious that, if the 70-persistent-cd.rules file don't exist, when the system starts don't creates the file, and then you power up the external drive, udev creates the file, but it contains only information for the external drive.
Comment 10 Matthias Schwarzott gentoo-dev 2007-03-31 10:23:55 UTC
The bahaviour seems correct as you describe it:
While bootup/starting udev /etc/udev/rules.d is not yet writable, and udev stores the created rules under /dev.

That rules are written to /etc/udev/rules.d/ when shutting down.