LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 05-04-2010, 08:45 PM   #1
jdmcdaniel3
Member
 
Registered: Jan 2006
Location: Austin
Distribution: openSUSE 11.2
Posts: 167

Rep: Reputation: 31
Lightbulb openSUSE Multimedia Optical Devices /dev/dvd & /dev/cdrom Configuration


Well, I have come to a new understanding of optical drive naming and just what openSUSE seems to be doing for us automatically each time we boot up SuSE. There is a file that registers each cdrom or dvd drive that is connected to our computers. It provides symbolic device links for each optical drive and places them in the /dev folder. As I talk about optical drive names, I will add the folder name /dev/ in front of the name, but this is assumed in the configuration text file and not shown.

And the name and the location of this optical drive configuration text file is:

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

Now my main openSUSE computer has but one optical drive (the hardware name for it is /dev/sr0) and so here is a look at my 70-persistent-cd.rules optical configuration text file.

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

# DVDRAM_GH24NS50 (pci-0000:00:12.0-scsi-2:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="dvd1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="dvdrw1", ENV{GENERATED}="1"
There will be a five line entry per optical drive you have installed in your system and a five line entry for any drive that used to exist, but has now been removed. My single optical DVD drive is an LG 24X model. But I had to get the box out to discover its model number was GH24NS50 as it appears in the above text file. After playing around with my optical drive I discovered that a new entry is made for each new or added drive found in your system. Further, for each additional optical drive installed, you will notice that the device names keep going up by one number. By that I mean the first optical drive uses cdrom1, cdrw1, dvd1, dvdrw1 while the next will be cdrom2, cdrw2, dvd2, dvdrw2 and so on. If you replace a drive, you may find two entries with the same ending number. To see how this works, I went to kaffeine/KDE3 and modified the XINE media entries for cdrom and dvd to be /dev/cdrom1 & /dev/dvd1 respectively. I had changed them both to /dev/sr0 which is the actual drive name for my optical drive. Using the new names found in the 70-persistent-cd.rules text file causes a DVD to play in Kaffeine.

First off, the 70-persistent-cd.rules optical drive configuration text file only lists the ending device names like cdrom?, cdrw?, dvd? or dvdrw?. No /dev/ is in front of the name. That is because symbolic device links are being created in the /dev folder and so the name /dev/ is assumed in all cases to be in front of the device names. Also, another thing that may become obvious here is there are no entries that specifies the default /dev/dvd or /dev/cdrom names, the two names that seem to show up all over Linux for optical drives. The answer is simple, there is no automatic method that can assign these names that makes sense since only one optical drive can use the /dev/dvd or /dev/cdrom device names, though these two names could point to two different optical drives.

In my case, the answer is simple, just add the /dev/dvd and /dev/cdrom names for my single optical drive. Thus here is a copy of my modified 70-persistent-cd.rules text file. I just copied the last line twice and changed dvdrw1 to cdrom first and in the other line to dvd.

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

# DVDRAM_GH24NS50 (pci-0000:00:12.0-scsi-2:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="dvd1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="dvdrw1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:12.0-scsi-2:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
Now after making this change, even the CD player KsCD works with my audio CD's. There are some programs like Banshee that did not have any problems reading my audio CD's without making any changes to the 70-persistent-cd.rules text file, but this seemed to make more programs work properly for me. I found that mplayer could now find and play my DVD's. It is possible to start mplayer from the command line with the correct dvd drive listed, but it is better to not have to do that at all using 70-persistent-cd.rules text file.

What this text file is doing is providing symbolic device links for your optical drives in your /dev folder pointing to your real hardware. Further, you could create a symbolic link in /dev manually if you wanted to and knew how to do it that pointed /dev/cdrom & /dev/dvd to your correct optical drives, but why bother if this file will do it for you automatically? If you should replace an optical drive, the old and new entries will be present and I determined that you can delete the old entry if you wish. When a drive is replaced you will need to edit this file again to add the /dev/dvd & /dev/cdrom to point to your new optical drive. If you have more than one optical drive, there will be one entry set of five lines per optical drive made automatically for you. Make your entry for /dev/cdrom and/or /dev/dvd under the existing lines for the selected optical drive and you can only have one /dev/cdrom entry and one /dev/dvd entry in this entire file. Only ONE /dev/dvd entry per file and only ONE /dev/cdrom per file. Got it?

To edit this file you need root privilege. To use kwrite to do the editing use the following command:

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

After making any changes to the 70-persistent-cd.rules text file you must reboot your computer to see how it works. You should think about this file as creating Alias names for your optical drives. Your hardware name may be /dev/sr0, but now in my case /dev/cdrom, /dev/dvd, /dev/cdrom1, /dev/cdrw1, /dev/dvd1, /dev/dvdrw1 all point to the same hardware drive /dev/sr0 through the use of the70-persistent-cd.rules optical drive configuration text file. To get a real list of the hardware names for all drives installed in your system, open up a terminal session and enter the command "df -T", without the quotes.

Please let me know if you have any questions about using this procedure to add /dev/dvd and /dev/cdrom to your configuration file. Programs that look for these will now work properly. Also, now you know that you could modify your device entries to use the automatically added drives like /dev/dvd1 or /dev/cdrom1 if you wanted to. Knowing how the 70-persistent-cd.rules optical drive configuration text file works will make you a smarter openSUSE Linux user.

Thank You,

Last edited by jdmcdaniel3; 05-04-2010 at 09:13 PM.
 
Old 10-31-2010, 12:54 PM   #2
linasturex
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
Thumbs up Thanks - editing 70-persistent-cd.rules fixed my issue too.

Quote:
Originally Posted by jdmcdaniel3 View Post
Well, I have come to a new understanding of optical drive naming and just what openSUSE seems to be doing for us automatically each time we boot up SuSE. There is a file that registers each cdrom or dvd drive that is connected to our computers. It provides symbolic device links for each optical drive and places them in the /dev folder.
Thank you dmcdaniel3. You have just solved my problem.

My situation was a bit different because I hadn't installed a new optical drive. My PC has a couple of hard disks hard disks however and I had swapped the straps around while removing one of the HDDs to make sure I couldn't accidentally overwrite anything while installing a new version of openSUSE on the other HDD, thus swapping master/slave.

So I think I landed up with two entries in the /etc/udev/rules.d/70-persistent-cd.rules for the same optical drive, but the correct entry was not the one that my apps were looking for.

My 70-persistent-cd.rules file was as follows:

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

# COMBO_SOHC-5232K (pci-0000:00:1f.1-scsi-1:0:1:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-1:0:1:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-1:0:1:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-1:0:1:0", SYMLINK+="dvd1", ENV{GENERATED}="1"
My apps were all looking for 'cdrom' which was scsi-1:0:0:0, when the drive is actually scsi-1:0:1:0 which is pointed to by 'cdrom1', but the apps weren't using 'cdrom1'.

So I changed the cdrom, cdrw and dvd entries to be scsi-1:0:1:0, rebooted and now it all works fine .

I guess I could now get rid of the cdrom1, cdrw1 and dvd1 entries, but for the time-being, 'if it ain't broke don't fix it'.

Many thanks
Doug
 
Old 10-31-2010, 01:06 PM   #3
linasturex
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
FYI I posted my original query, giving the symptoms, on the openSUSE forums here: http://bit.ly/bAwwEP
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenSUSE x86_64 does not mount /dev/tape (or /dev/st0 or /dev/nst0) yankeeinga Linux - Newbie 6 08-21-2008 12:51 PM
/dev & /udev and cdrom / dvd drives craftybytes Debian 2 11-12-2006 06:02 PM
/dev/cdrom & /dev/hdc missing! Lord_Devi Slackware 4 06-25-2004 09:17 AM
mounting 2 ide-scsi devices /dev/cdrom and /dev/cdrom1 issue penguin123 Linux - Hardware 3 09-26-2003 08:36 PM
Two Video Devices - /dev/video0 & /dev/video1 liguorir Linux - Software 1 07-21-2003 08:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 01:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration