Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
no /dev/dvd, but /dev/cdrom exists
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Sun Feb 03, 2013 5:34 pm    Post subject: no /dev/dvd, but /dev/cdrom exists Reply with quote

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:
Code:
$ 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.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 5674

PostPosted: Sun Feb 03, 2013 8:33 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Sun Feb 03, 2013 8:52 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ssuominen
Developer
Developer


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Sun Feb 03, 2013 9:11 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Sun Feb 03, 2013 11:57 pm    Post subject: Reply with quote

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:
Code:
-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
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2643
Location: Slovenia

PostPosted: Mon Feb 04, 2013 1:06 am    Post subject: Reply with quote

Code:
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
Code:
SUBSYSTEMS=="scsi", KERNEL=="sr0", SYMLINK+="cdrom dvd"
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Tue Feb 05, 2013 9:52 pm    Post subject: Reply with quote

I find this handy:

In /etc/mplayer/mplayer.conf:
Code:

# Use the kernel's device name.
cdrom-device=/dev/sr0
dvd-device=/dev/sr0


Then I can play an audio cd with mplayer with
Code:

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.
_________________
TIA
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum