[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Udev and device name unstable



T o n g wrote:

 $ cat /etc/udev/rules.d/70-persistent-cd.rules
 # This file was automatically generated by the /lib/udev/write_cd_rules
 # program, run by the cd-aliases-generator.rules rules file.
 #
 # You can modify it, as long as you keep each rule on a single
 # line, and set the $GENERATED variable.

 # CD-RW_CRX195E1 (pci-0000:00:06.0-scsi-0:0:0:0)
 ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:06.0-scsi-0:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
 ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:06.0-scsi-0:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
 # DVD-RW_DVR-110D (pci-0000:00:06.0-scsi-0:0:1:0)
 ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:06.0-scsi-0:0:1:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
 ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:06.0-scsi-0:0:1:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"
 ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:06.0-scsi-0:0:1:0", SYMLINK+="dvd1", ENV{GENERATED}="1"
 ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:06.0-scsi-0:0:1:0", SYMLINK+="dvdrw1", ENV{GENERATED}="1"

So how can I get back the "dvd" symlinks instead of dvd1?

The naming convention does not seem reasonable to me: in this file,
cdrom1 is actually the 2nd cdrom, whereas dvd1 is not the 2nd but the
1st dvd device.

Agreed, cdrom1 is the second cdrom device and dvd1 is not the second dvd device, but they ARE the SAME device, so the symlinks were given the same suffix. I haven't messed too much with my udev rules, but, it seems that you could just remove the "1" from the end of "dvd1" and "dvdrw1" in the rules and you should get the behavior that you want. You will probably need to reboot after making the changes.

--
Marc Shapiro
mshapiro_42@yahoo.com



Reply to: