# no /dev/dvd, but /dev/cdrom exists

## alex.blackbit

Hi,

I don't need my cdrom drive very often so I don't know how long this problem already exists.

It's best described by console output:

```
$ cat /etc/udev/rules.d/70-persistent-cd.rules 

# This file was automatically generated by the /lib64/udev/write_cd_rules

# program, probably 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.

# HL-DT-ST_DVDRAM_GSA-U20N (pci-0000:00:1f.2-scsi-0:0:0:0)

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

$ ls -l /dev/{cdrom,cdrw,dvd,dvdrw,sr*}

ls: cannot access /dev/cdrw: No such file or directory

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

ls: cannot access /dev/dvdrw: No such file or directory

lrwxrwxrwx 1 root root      3 Feb  3 18:15 /dev/cdrom -> sr0

brw-rw---- 1 root cdrom 11, 0 Feb  3 18:15 /dev/sr0

$ 
```

Is there any obvious reason for that?

Thanks in advance.

----------

## VoidMage

udev has stopped generating those rules, so the chances are the ones present are out of date.

But a single /dev/cdrom symlink should be present.

----------

## alex.blackbit

 *VoidMage wrote:*   

> udev has stopped generating those rules, so the chances are the ones present are out of date.

 

What should that mean? Maybe udev does not generate these rules now, but they _are_ present on my system.

The syntax of the rules did not change afaik.

I do not understand why the rules in this file do not have any effect.

Do you have an explanation?

 *VoidMage wrote:*   

> But a single /dev/cdrom symlink should be present.

 

Yes, as I already wrote.

----------

## SamuliSuominen

 *alex.blackbit wrote:*   

> I do not understand why the rules in this file do not have any effect.

 

The way /dev/cdrom is created also changed; the old persistent cd rules are not supposed to work anymore as the whole ATA transport class is skipped in that part of udev code.

----------

## alex.blackbit

Thanks for your answer, ssuominen.

I assume that my rules file is a leftover.

Maybe an udev update in the past instructed me to delete it and i overlooked that, I am not sure.

Since these symlinks are handy for various things, I would like to have them back.

Is there any easy way to achieve this?

Also, how do I find out which of my rules under /etc/udev/rules.d are obsolete?

I have these:

```
-rw-r--r-- 1 root root  807 May  1  2012 70-persistent-cd.rules

-rw-r--r-- 1 root root  633 May 16  2012 70-persistent-net.rules

-rw-r--r-- 1 root root 1.7K Jan 14 22:30 80-net-name-slot.rules
```

----------

## Gusar

```
udevadm info --query=property --name=/dev/sr0
```

That will show you the attributes you can use. Your outdated rules file probably uses an attribute that doesn't exist anymore. The simplest rule if you only have a single optical drive is

```
SUBSYSTEMS=="scsi", KERNEL=="sr0", SYMLINK+="cdrom dvd"
```

----------

## wcg

I find this handy:

In /etc/mplayer/mplayer.conf:

```

# Use the kernel's device name.

cdrom-device=/dev/sr0

dvd-device=/dev/sr0

```

Then I can play an audio cd with mplayer with

```

mplayer cdda://

```

regardless of what udev does with aliases of /dev/sr0.

Adjust your other software that hardcodes device pathnames

to aliases of /dev/sr0 like /dev/cdrom, /dev/dvd, etc, to actually

use /dev/sr0, and a lot of problems go away.

----------

