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

Re: Udev and device name unstable



On Tue, 12 May 2009 10:20:31 +0300, Andrei Popescu wrote:

> > My DVD device is used to be /dev/dvd or /dev/dvdrw. But today
> > after I rebooted my box, there are no /dev/dvd or /dev/dvdrw
> > devices any more. They are changed to /dev/dvd1 and /dev/dvdrw1
> > instead.
>  
> Those are usually symbolic links to the real device:
> 
> $ ls -l /dev/dvd*
> lrwxrwxrwx 1 root root 3 2009-05-12 09:05 /dev/dvd -> hda
> lrwxrwxrwx 1 root root 3 2009-05-12 09:05 /dev/dvdrw -> hda

I know. Mine is:

 $ ls -l /dev/dvd*
 lrwxrwxrwx 1 root root 3 05-11 18:20 /dev/dvd1 -> sr1
 lrwxrwxrwx 1 root root 3 05-11 18:20 /dev/dvdrw1 -> sr1

> > This make it very inconvenient for me, since all my scripts (and
> > fstab) are using hard-coded /dev/dvd. Why is My DVD device name
> > get changed this time?  AFAIK, I didn't make any changes to the
> > system (package upgrading or config file changing).
> 
> Maybe you added or removed some hardware? My guess is the PCI id for 
> your DVD has changed.

No, HW is not touched either, apart from SW. Just reboot, that's all.
 
> > Is there any way to tell udev to rescan the devices or specific
> > devices, so that I don't need to reboot to correct this?
> 
> Please post your /etc/udev/rules.d/70-persistent-cd.rules file.

 $ 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.

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/


Reply to: