This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 552762

Summary: symlinks for /dev/cdrom, /dev/dvd disappear after a while
Product: [Fedora] Fedora Reporter: Chris Elmquist <chrise>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 12CC: harald, rmj, stephent98
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-01-26 05:54:16 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Chris Elmquist 2010-01-05 22:45:12 EST
Description of problem:

Symlinks from /dev/sr0 to /dev/cdrom, /dev/dvd, etc disappear after the
system has been up for a while.

Version-Release number of selected component (if applicable):

FC12
Don't know for sure this is a udev bug... might be HAL... dunno how much of
this device node handling stuff works anymore...

How reproducible:

Happens every day.  Still determining exactly how long after boot but
they will definitely be gone after one day's time

Steps to Reproduce:
1. Boot system
2. /dev/cdrom -> /dev/sr0
3. system sits idle over night
4. /dev/cdrom has disappeared
5. install cd or dvd media, /dev/cdrom still gone
6. autofs cannot automount any media because device link is missing
  
Actual results:

/dev/cdrom, /dev/dvd symlinks disappear on their own for no apparent reason

Expected results:

/dev/cdrom, /dev/dvd symlinks should persist as long as the system is up!

Additional info:

Stock FC12 install, fully updated as of Jan-05-2010
Comment 1 Roderick Johnstone 2010-01-07 05:11:07 EST
+1
Comment 2 Steve Tyler 2010-01-25 12:28:09 EST
Simply inserting a movie DVD results in the symlinks to the optical device being removed.

Steps to reproduce:
1. Boot system.
2. ls -l /dev/cdrom /dev/dvd
3. Insert a movie DVD.
4. Wait for it to be mounted on the desktop.
5. ls -l /dev/cdrom /dev/dvd
6. ls -l /dev | grep sr0
7. eject # command from terminal window

After booting, all the symlinks to the optical device are present. After inserting a DVD, the symlinks are gone except for scd0.

The system is a fresh install with the latest updates.
Fedora 12 x86_64
udev-145-14.fc12.x86_64
Linux walnut 2.6.31.12-174.2.3.fc12.x86_64 #1 SMP Mon Jan 18 19:52:07 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

NB: This breaks xine and the eject command. Totem can find the DVD (although menu items cannot be selected from the DVD's menu).

[stephent@walnut ~]$ ls -l /dev/cdrom /dev/dvd
lrwxrwxrwx 1 root root 3 2010-01-25 07:45 /dev/cdrom -> sr0
lrwxrwxrwx 1 root root 3 2010-01-25 07:45 /dev/dvd -> sr0

[stephent@walnut ~]$ # insert dvd

[stephent@walnut ~]$ ls -l /dev/cdrom /dev/dvd
ls: cannot access /dev/cdrom: No such file or directory
ls: cannot access /dev/dvd: No such file or directory

[stephent@walnut ~]$ ls -l /dev | grep sr0
lrwxrwxrwx  1 root root           3 2010-01-25 07:45 scd0 -> sr0
brw-rw----+ 1 root cdrom    11,   0 2010-01-25 07:45 sr0

[stephent@walnut ~]$ eject
eject: unable to find or open device for: `cdrom'
Comment 3 Steve Tyler 2010-01-25 12:33:52 EST
(In reply to comment #2)
> Simply inserting a movie DVD results in the symlinks to the optical device
> being removed.
> 
> Steps to reproduce:

This is with the Gnome desktop and nautilus:
gnome-desktop-2.28.2-3.fc12.x86_64
nautilus-2.28.4-1.fc12.x86_64
Comment 4 Steve Tyler 2010-01-25 12:45:23 EST
(In reply to comment #2)
> Simply inserting a movie DVD results in the symlinks to the optical device
> being removed.
> 
> Steps to reproduce:

Happens with a data DVD (e.g. F12 installer DVD) and an audio CD too.
Comment 5 Chris Elmquist 2010-01-25 12:56:37 EST
Updating information on my situation,

I run with IceWM desktop manager and none of the Gnome or KDE
desktop installed

I have been able to mitigate this issue by executing the script

    /lib/udev/write_cd_rules

which then created the file,

    /etc/udev/rules.d/70-persistent-cd.rules

which contains,

# CDDVDW_SH-S222A (pci-0000:00:1f.1-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

and now my /dev/cdrom symlinks stop disappearing.

I have no idea if this is a proper or valid solution other than it
seems to be working here.  I would offer that the user should not have to
do this however.  So something is still not right with installation or
monitoring of the cdrom/dvd device.
Comment 6 Steve Tyler 2010-01-25 15:10:32 EST
(In reply to comment #5)
> Updating information on my situation,
> 
> I run with IceWM desktop manager and none of the Gnome or KDE
> desktop installed
> 
> I have been able to mitigate this issue by executing the script
> 
>     /lib/udev/write_cd_rules
> 
> which then created the file,
> 
>     /etc/udev/rules.d/70-persistent-cd.rules
> 
> which contains,
...

Thanks, Chris! As it happens, I have a Fedora 11 installation on a separate hard drive, and it has 70-persistent-cd.rules. I just copied it into /etc/udev/rules.d/ on my Fedora 12 installation and now my symlinks are persistent. xine and the eject command work. Totem still has problems, so those would seem to be unrelated to this bug.

The comment at the top of 70-persistent-cd.rules says cd-aliases-generator.rules should invoke write_cd_rules.

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

# DVDRW_SHW-160P6S (pci-0000:00:14.1-scsi-1:0:1:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-1:0:1:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-1:0:1:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-1:0:1:0", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-1:0:1:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"
Comment 7 Steve Tyler 2010-01-25 15:44:52 EST
(In reply to comment #6)
> ... I have a Fedora 11 installation on a separate
> hard drive, and it has 70-persistent-cd.rules.

Booted into F11, updated, rebooted.
Confirming that symlinks are persistent in F11.

For the record:

udev-141-7.fc11.i586

Linux cedar 2.6.30.10-105.2.4.fc11.i586 #1 SMP Tue Jan 19 22:31:48 UTC 2010 i686 athlon i386 GNU/Linux
Comment 8 Steve Tyler 2010-01-25 17:26:46 EST
This problem does not occur on my laptop, which was *upgraded* from Fedora 11 to Fedora 12. It has 70-persistent-cd.rules:

-rw-r--r-- 1 root root 1248 2008-02-25 13:57 /etc/udev/rules.d/70-persistent-cd.rules

udev-145-14.fc12.i686

Roderick: Did you do an upgrade or a fresh install of F12?
Comment 9 Harald Hoyer 2010-01-26 05:54:16 EST

*** This bug has been marked as a duplicate of bug 557771 ***
Comment 10 Roderick Johnstone 2010-01-26 09:00:08 EST
Steve: I did a fresh install of F12.