/dev/dvd disappears when a DVD is inserted

Bug #993728 reported by Charles Lindsay
78
This bug affects 16 people
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

On a fresh boot, with no DVD inserted:

$ ls -Al /dev/dvd
lrwxrwxrwx 1 root root 3 May 2 18:25 /dev/dvd -> sr0

As soon as I insert a DVD:

$ ls -l /dev/dvd
ls: cannot access /dev/dvd: No such file or directory

The only new lines in dmesg are:

[ 88.411709] UDF-fs: Partition marked readonly; forcing readonly mount
[ 88.472834] UDF-fs: INFO Mounting volume 'WILLIAM_CASTLE_FILM_COLLECTION', timestamp 2009/08/19 19:32 (1e5c)

This is on a fully updated install of Ubuntu 12.04, with udev 175-0ubuntu9.

I don't want /dev/dvd to stop existing exactly when I need to use it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in udev (Ubuntu):
status: New → Confirmed
Revision history for this message
lnxusr (bjwest) wrote :

When I rebooted I did a 'ls /dev', noticed the proper symlinks and though all was well. I inserted a dvd to check things out and low and behold the symlinks disappeared. A quick 'ls /etc/udev/rules.d' showed no 70-persistent-cd.rules file.

I grabbed the file from my laptop and edited it to match my desktop setup.

# This file maintains persistent names for CD/DVD reader and writer devices.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-cd-aliases-generator.rules
# file; however you are also free to add your own entries provided you
# add the ENV{GENERATED}=1 flag to your own rules as well.
# TSSTcorp_CDDVDW_SH-222BB (pci-0000:00:11.0-scsi-2:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-2:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-2:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-2:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-2:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

Here's the steps to get the above:

Note, this is all done in a terminal. There may be a pointy-clicky way to do it, but this was easiest for me..

If you don't know the device id for your drive, type

$ sudo lshw -C disk

and look for the '*-cdrom' block. The line 'bus info: scsi@2:0.0.0' is what you're looking for.

$ ls /dev/disk/by-path

will give you the 'pci-000:00:11.0-' portion. This may be the same for all, not sure.

I'm also not sure about the last commented line, that may just be human info, but you can get that from /dev/disk/by-id. Mine was ata-TSSTcorp_CDDVDW_SH-222BB_R8LM68FC5008YP, and I just trimmed off the first and last parts to match the part my laptop had in it's file.

This bug may be a problem with either a missing or mismatched /etc/udev/rules.d/70-persistent-cd.rules file.

Revision history for this message
Charles Lindsay (chazomaticus) wrote :

Interestingly, my 70-persistent-cd.rules exists, it's just effectively empty:

$ cat /etc/udev/rules.d/70-persistent-cd.rules
# This file maintains persistent names for CD/DVD reader and writer devices.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-cd-aliases-generator.rules
# file; however you are also free to add your own entries provided you
# add the ENV{GENERATED}=1 flag to your own rules as well.

I wonder if Ubuntu didn't properly detect something when it was installing itself? For reference, here's the pertinent output of some of the commands you mention, from my machine:

$ sudo lshw -C disk
...
  *-cdrom
       description: DVD-RAM writer
       product: BD-RE WH10LS30
       vendor: HL-DT-ST
       physical id: 0.0.0
       bus info: scsi@3:0.0.0
       logical name: /dev/sr0
       version: 1.00
       capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
       configuration: ansiversion=5 status=nodisc

$ ls /dev/disk/by-path/
... pci-0000:00:11.0-scsi-3:0:0:0

$ ls -Al /dev/disk/by-id/
...
lrwxrwxrwx 1 root root 9 Jul 9 23:38 ata-HL-DT-ST_BD-RE_WH10LS30_K97A3NA2854 -> ../../sr0

Does any of that matter? I doubt it. I'd have to check specifically, but I'm fairly certain I get the same problem on all other machines I use.

Revision history for this message
Trent McPheron (tiz-ex1) wrote :

This is still present in Quantal. I can't fix it the same way as you guys, though... for some reason, the bus info of my dvd drive doesn't match anything in /dev/disk/by-path.

trent@TiZWorkBox:~$ sudo lshw -C disk
  *-disk
       description: ATA Disk
       product: WDC WD2500AAKX-7
       vendor: Western Digital
       physical id: 0.0.0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: 19.0
       serial: WD-WMAYW1800352
       size: 232GiB (250GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 sectorsize=512 signature=03ecac1c
  *-cdrom
       description: DVD-RAM writer
       product: DVD+-RW GH70N
       vendor: HL-DT-ST
       physical id: 0.0.0
       bus info: scsi@1:0.0.0
       logical name: /dev/sr0
       version: A101
       capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
       configuration: ansiversion=5 status=nodisc
  *-disk:0
       description: SCSI Disk
       physical id: 0.0.0
       bus info: scsi@6:0.0.0
       logical name: /dev/sdb
       configuration: sectorsize=512
  *-disk:1
       description: SCSI Disk
       physical id: 0.0.1
       bus info: scsi@6:0.0.1
       logical name: /dev/sdc
       configuration: sectorsize=512
  *-disk:2
       description: SCSI Disk
       physical id: 0.0.2
       bus info: scsi@6:0.0.2
       logical name: /dev/sdd
       configuration: sectorsize=512
  *-disk:3
       description: SCSI Disk
       physical id: 0.0.3
       bus info: scsi@6:0.0.3
       logical name: /dev/sde
       configuration: sectorsize=512
  *-disk:4
       description: SCSI Disk
       physical id: 0.0.4
       bus info: scsi@6:0.0.4
       logical name: /dev/sdf
       configuration: sectorsize=512
trent@TiZWorkBox:~$ ls /dev/disk/by-path
pci-0000:00:1a.0-usb-0:1.2.1:1.0-scsi-0:0:0:0
pci-0000:00:1a.0-usb-0:1.2.1:1.0-scsi-0:0:0:1
pci-0000:00:1a.0-usb-0:1.2.1:1.0-scsi-0:0:0:2
pci-0000:00:1a.0-usb-0:1.2.1:1.0-scsi-0:0:0:3
pci-0000:00:1a.0-usb-0:1.2.1:1.0-scsi-0:0:0:4
pci-0000:00:1f.2-scsi-0:0:0:0
pci-0000:00:1f.2-scsi-0:0:0:0-part1
pci-0000:00:1f.2-scsi-0:0:0:0-part2
pci-0000:00:1f.2-scsi-0:0:0:0-part3
pci-0000:00:1f.2-scsi-0:0:0:0-part4

Revision history for this message
Joachim Schwender (jschwender) wrote :

I configured mplayer (~/.mplayer/config) and vlc ( ~/.config/vlc/vlcrc) to use /dev/sr0 instead of the default /dev/dvd device. This way at least these applications work properly.

Revision history for this message
Tuomo Sipola (tuomosipola) wrote :

Started affecting my computer after 13.04 -> 13.10 upgrade. /dev/dvd disappears.

Revision history for this message
Forest (foresto) wrote :

See also: bug 926976.

Revision history for this message
Charles Lindsay (chazomaticus) wrote :

I just re-tested this (now on udev 175-0ubuntu9.4), and the problem is gone. I guess we can say this bug is fixed, at least for me, under the conditions for which I opened it. Not sure whether it was a udev change or something else. Oh well.

Interesting take-away from bug 926976 is that /dev/dvd's days are numbered. Sounds like it won't be available in future versions.

Changed in udev (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Pierre (pierrewinnipeg) wrote :

I have a similar problem. Can anybody help?

Gnome-mplayer cannot my commercial dvd because it is mounted to /dev/sr0. It looks for /dev/dvd but cannot find it. It seems that below the logical name: /dev/dvd. Could this be the problem? Is this a hardware problem?

Please Help!

sudo lshw -c disk

  *-cdrom
       description: DVD-RAM writer
       product: CD/DVDW TS-H652D
       vendor: TSSTcorp
       physical id: 0.0.0
       bus info: scsi@0:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/sr0
       logical name: /media/myusername/DVDVIDEO
       version: GA01
       capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
       configuration: ansiversion=5 mount.fstype=udf mount.options=ro,nosuid,nodev,relatime,uid=1000,gid=1000,umask=77,iocharset=utf8 state=mounted status=ready
     *-medium
          physical id: 0
          logical name: /dev/cdrom
          logical name: /media/pch/DVDVIDEO
          configuration: mount.fstype=udf mount.options=ro,nosuid,nodev,relatime,uid=1000,gid=1000,umask=77,iocharset=utf8 state=mounted

Revision history for this message
Forest (foresto) wrote :

You folks whose media players are still broken by the missing /dev/dvd link might want to open a new bug report, especially if your /dev/dvd is not even present at boot time with an empty DVD drive. I suggest emphasizing that this problem breaks the average user's ability to play DVDs, since there still seem to be some developers involved who think it's okay to break a user's working system in the name of "progress". (The correct way to handle deprecating /dev/dvd would have been to keep supporting it until all the widely-used players were updated to use /dev/sr0 by default. That obviously has not been done here.)

Revision history for this message
Martin Pitt (pitti) wrote :

For the record, I finally fixed this for good in bug 1323777.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.