Multimedia Optical Drive Naming (ie /dev/dvd & /dev/cdrom) How To in openSUSE

Can the techniques described in this thread be used to spoof the OS into thinking that there is a CDROM drive present if physically there is not? I ask because the oS builds of XBMC will not run unless there is a CDROM drive present. This prevents me from using it on my Thinkpad laptop and Acer Revo Nettop PC.

Hi jdmcdaniel3,

With openSUSE11.x two optical drives have never worked properly on my system. Hence the system was left with just the DVD writer installed.

After reading your procedure, I gave it a try and it worked. But the mouse became unresponsive, sometimes for up 30 seconds. I’m now back to one optical drive.

The trial installation was a DVD-RAM_GH22NP20 and a DVD-ROM_DVD-105F on the same ide cable, each set to CS with the DVD-RAM comming up as the primary. Maybe they are not compatable.

The trial installation was a DVD-RAM_GH22NP20 and a DVD-ROM_DVD-105F on the same ide cable, each set to CS with the DVD-RAM coming up as the primary. Maybe they are not compatible.
hello keellambert, nothing sounds incompatible with those two drives to me. I would say that you could switch the master around. Using Cable select just means swapping the plugs around and I think the end one is master with cable Select. If the other drive works OK as master, perhaps you will not have the mouse pauses like you did before. It is worth a try before you give up, if you have not already tried this.

Thank You,

I don’t think so. I know how to mount an iso-File and I know how to set a device link, but I think that XBMC looks for a device and not just for a device link. So you should try to post this question into an XBMC forum.

Hi jdmcdaniel3,

Thanks for the advice it worked. By setting the DVD-RAM as master and DVD-ROM as slave there is no mouse interference.

Hi jdmcdaniel3,

Thanks for the advice it worked. By setting the DVD-RAM as master and DVD-ROM as slave there is no mouse interference.
Hey I love it when a plan comes together and provides a solution. It has been a while since I messed around with IDE master and slaves, but the very issue you saw did occur to me, even under Windows. It seemed like the DVD writer or CD writer was best to be placed as the master over just a player only. So, I am happy to hear that some things are still true today. Thanks so much for taking the time to let us know of this outcome. You would be surprised how often we just never hear of the final results. And as always, if we can be of help to you in the future, you need only ask.

Thank You,

i found very interesting your topic, jdmcdaniel3, thank you for sharing it with us. I tried to see how is setup on my machine, openSUSE 12.2 with KDE 4.8.5 as I noticed few days ago that I’m having problems with my DVD writer.
here is the contents of my /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.

# Optiarc_DVD_RW_AD-7260S (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"

# PlayBook_CD (pci-0000:00:12.2-usb-0:1:1.0-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="RIM_PlayBook_CD_774381a59cdbe092b86a2a9eb94cb43d63ce252e-0:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"

what I found interesting is the PlayBook_CD entry, which was a long time ago connected directly via USB, in this file. I wouldn’t have thought that it will be mounted this way.
Not sure if this is creating the problem with my DVD, and I will try as per suggestions in this thread to create a new file /etc/udev/rules.d/75-persistent-cd.rules w/o the PlayBook_CD info in it and see if that changes anything.

If you have only one optical drive and its able to read and write, all standard names get assigned to it. It gets more interesting if you have more than one optical drive, replace an optical drive or have a read only drive. You can always remove this file and restart openSUSE to have it recreated and current to your present setup. Many programs such as k3b don’t care about this files contents but many media players do adhere to its settings, so knowing that this file exists and just what it does is helpful to understand.

Thank You,

I had problems with not being able to read CD/DVD’s for a while but was not that critical to solve it. Now that i have some time to try to understand this I was trying to re-read and figure out the problem according to this excellent thread by jmcdaniel.
So not sure how my /etc/udev/rules.d/70-persistent-cd.rules got one more CD-ROM added.(the last one in the file:

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

# Optiarc_DVD_RW_AD-7260S (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"

# PlayBook_CD (pci-0000:00:12.2-usb-0:1:1.0-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="RIM_PlayBook_CD_774381a59cdbe092b86a2a9eb94cb43d63ce252e-0:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"

# Optiarc_DVD_RW_AD-7260S (pci-0000:00:11.0-scsi-1:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-1:0:0:0", SYMLINK+="cdrom2", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-1:0:0:0", SYMLINK+="cdrw2", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-1:0:0:0", SYMLINK+="dvd2", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-1:0:0:0", SYMLINK+="dvdrw2", ENV{GENERATED}="1"

so after I made a copy of it and since I cannot get my cd/DVD to work I tried to play around and I deleted the /etc/udev/rules.d/70-persistent-cd.rules file, I rebooted the system and
expected to see a new file created. The file was not created which makes me think that somehow physically the system doesn’t see any DVD and it doesn’t need to create this file. Should be an empty file created? Did I miss something in the thread saying otherwise? I will have to check also in BIOS if it is recognized first the DVD. But my quest to find a solution is still under way.

… and I deleted the /etc/udev/rules.d/70-persistent-cd.rules file, I rebooted the system and
expected to see a new file created. The file was not created which makes me think that somehow physically the system doesn’t see any DVD and it doesn’t need to create this file. Should be an empty file created? Did I miss something in the thread saying otherwise? I will have to check also in BIOS if it is recognized first the DVD. But my quest to find a solution is still under way.

Yes, the file should have been recreated automatically on detection of your hardware at boot.

As long as the kernel detected the drive, then /dev/sr0 should at least exist.

ls -l /dev/sr*

If the device is present, then try the following from a root terminal

echo add > /sys/block/sr0/uevent

Does /etc/udev/rules.d/70-persistent-cd.rules now exist again?

I looked at two PC’s running openSUSE 12.3 and this rules file for optical drive naming is no longer there. I assume if you did a clean install of openSUSE, not an upgrade, you no longer have this file either. I found a year plus old message saying that this was being removed from udev, but I am not seeing any message from openSUSE that was published about this fact.

linux/hotplug/udev.git - udev development tree

The file** /lib/udev/rule.d/60-cdrom_id.rules**, now seems to be used with only the first drive being picked up. I guess this message thread and fix have been changed and no longer exactly apply to openSUSE 12.3.

Thank You,

Does /lib/udev/rules.d/75-cd-aliases-generator.rules still exist? (That was responsible for the generation of the legacy file in /etc/udev/rules.d/ directory).

Nope, that file is not there. Here is a complete list:

ls -1 /lib/udev/rules.d/

10-dm.rules
11-dm-lvm.rules
13-dm-disk.rules
40-libgphoto2.rules
40-usb-media-players.rules
40-usb_modeswitch.rules
42-usb-hid-pm.rules
50-udev-default.rules
51-lirc.rules
56-idedma.rules
60-cdrom_id.rules
60-persistent-alsa.rules
60-persistent-input.rules
60-persistent-serial.rules
60-persistent-storage.rules
60-persistent-storage-tape.rules
60-persistent-v4l.rules
61-accelerometer.rules
61-gnome-bluetooth-rfkill.rules
64-btrfs.rules
64-md-raid.rules
65-xorg-wacom.rules
69-libmtp.rules
69-xorg-vmmouse.rules
70-power-switch.rules
70-printers.rules
70-uaccess.rules
70-udev-acl.rules
71-seat.rules
73-seat-late.rules
73-seat-numlock.rules
75-net-description.rules
75-persistent-net-generator.rules
75-probe_mtd.rules
75-tty-description.rules
77-mm-ericsson-mbm.rules
77-mm-longcheer-port-types.rules
77-mm-nokia-port-types.rules
77-mm-pcmcia-device-blacklist.rules
77-mm-platform-serial-whitelist.rules
77-mm-simtech-port-types.rules
77-mm-usb-device-blacklist.rules
77-mm-x22x-port-types.rules
77-mm-zte-port-types.rules
77-network.rules
77-nm-olpc-mesh.rules
78-sound-card.rules
80-drivers.rules
80-mm-candidate.rules
80-udisks2.rules
81-mount.rules
85-regulatory.rules
85-usbmuxd.rules
90-alsa-restore.rules
90-libgpod.rules
90-pulseaudio.rules
95-dm-notify.rules
95-keyboard-force-release.rules
95-keymap.rules
95-udev-late.rules
95-upower-battery-recall-dell.rules
95-upower-battery-recall-fujitsu.rules
95-upower-battery-recall-gateway.rules
95-upower-battery-recall-ibm.rules
95-upower-battery-recall-lenovo.rules
95-upower-battery-recall-toshiba.rules
95-upower-csr.rules
95-upower-hid.rules
95-upower-wup.rules
97-bluetooth-hid2hci.rules
97-bluetooth-serial.rules
99-systemd.rules

Thank You,

Okay, thanks for clarifying James.

@dmera: As you mentioned

I tried to see how is setup on my machine, openSUSE 12.2 with KDE 4.8.5

you should still have the /lib/udev/rules.d/75-cd-aliases-generator.rules (as I do), since it is supplied as part of the udev package

 rpm -qf /lib/udev/rules.d/75-cd-aliases-generator.rules 
udev-182-4.33.1.x86_64

This should act to create /etc/udev/rules.d/70-persistent-cd.rules if required. However, as James already mentioned the first discovered device (assigned /devsr0) is now handled by default with the /lib/udev/rules.d/60-cdrom_id.rules file. This will work sufficiently so long as it’s the preferred device (or only device) that gets the symlinking. Otherwise custom rules are still required.