Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   How to get /dev/cdrom (http://www.linux-archive.org/gentoo-user/475601-how-get-dev-cdrom.html)

Michael Sullivan 01-12-2011 03:11 PM

How to get /dev/cdrom
 
OK, for several years I have not had a /dev/cdrom. My workstation has
an internal cd-rom drive, which gets mapped to /dev/hda, and an external
DVD+R drive, which is mapped to /dev/sr0. When I look
at /etc/udev/rules.d/70-persistent-cd.rules I see:

camille rules.d # cat 70-persistent-cd.rules
# LITE-ON_COMBO_SOHC-5236K (pci-0000:00:1f.1-ide-0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
+="cdrw", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
+="dvd", ENV{GENERATED}="1"
# LITE-ON_COMBO_SOHC-5236K (pci-0000:00:1f.1-ide-0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
+="cdrom1", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
+="cdrw1", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
+="dvd1", ENV{GENERATED}="1"
# CD.DVDW_SD-R5372 (pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK
+="cdrom2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK
+="cdrw2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK
+="dvd2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0", SYMLINK
+="dvdrw2", ENV{GENERATED}="1"
# CD.DVDW_SD-R5372 (pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD.DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="cdrom3", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD.DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="cdrw3", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD.DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="dvd3", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD.DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="dvdrw3", ENV{GENERATED}="1"
# CD.DVDW_SD-R5372 (pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0", SYMLINK
+="cdrom4", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0", SYMLINK
+="cdrw4", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0", SYMLINK
+="dvd4", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0", SYMLINK
+="dvdrw4", ENV{GENERATED}="1"
# LITE-ON_COMBO_SOHC-5236K (pci-0000:00:1f.1)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1f.1", SYMLINK+="cdrom5", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1f.1", SYMLINK+="cdrw5", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
ENV{ID_PATH}=="pci-0000:00:1f.1", SYMLINK+="dvd5", ENV{GENERATED}="1"

# CD_DVDW_SD-R5372 ()
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD_DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="cdrom6", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD_DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="cdrw6", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD_DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="dvd6", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
ENV{ID_SERIAL}=="TOSHIBA_CD_DVDW_SD-R5372_200503021764-0:0", SYMLINK
+="dvdrw6", ENV{GENERATED}="1"

LITE-ON_COMBO_SOHC-5236K is my internal drive, which SHOULD be mapped
to /dev/cdrom. But it's not:

camille rules.d # ls /dev/cdrom
ls: cannot access /dev/cdrom: No such file or directory


Why is it not being mapped correctly? Is the rule above not correct?
I've tried to read tutorials about writing udev rules, but the example
rules in the tutorials look nothing like the above rules, and I didn't
write those. I think they were created when udev was installed...

Paul Hartman 01-12-2011 03:28 PM

How to get /dev/cdrom
 
On Wed, Jan 12, 2011 at 10:11 AM, Michael Sullivan <msulli1355@gmail.com> wrote:
> Why is it not being mapped correctly? *Is the rule above not correct?
> I've tried to read tutorials about writing udev rules, but the example
> rules in the tutorials look nothing like the above rules, and I didn't
> write those. *I think they were created when udev was installed...

I guess you don't really have 6 optical drives installed? :)

Some of those have -ide- in the device name, did you change form IDE
to ATA kernel driver at some point (like most everyone else did)?
Maybe that's why. New entries are generated for drives that don't
match existing rules, which is probably why you see your SOHC-5236K
down at cdrom5 as well...

If you delete the file and reboot, it'll create a new one based on
your currently-installed hardware config. Hopefully that'll solve it
or at least clean up that file to the point where you can manage the
changes more easily.

01-12-2011 03:31 PM

How to get /dev/cdrom
 
Michael Sullivan <msulli1355@gmail.com> writes:

> OK, for several years I have not had a /dev/cdrom. My workstation has
> an internal cd-rom drive, which gets mapped to /dev/hda, and an external

If you're using a recent kernel, it's probably udev which refuses to
process devices under the old ATA driver.

(I don't know if it *exactly* refuses, or if it's something else, but
the final result is what you see, no /dev/{cdrom,cdrw,...} link)


> DVD+R drive, which is mapped to /dev/sr0. When I look
> at /etc/udev/rules.d/70-persistent-cd.rules I see:
>
> camille rules.d # cat 70-persistent-cd.rules
> # LITE-ON_COMBO_SOHC-5236K (pci-0000:00:1f.1-ide-0:0)
> ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
> +="cdrom", ENV{GENERATED}="1"
...
> # LITE-ON_COMBO_SOHC-5236K (pci-0000:00:1f.1-ide-0:0)
> ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-0:0", SYMLINK
> +="cdrom1", ENV{GENERATED}="1"
...
> # LITE-ON_COMBO_SOHC-5236K (pci-0000:00:1f.1)
> SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
> ENV{ID_PATH}=="pci-0000:00:1f.1", SYMLINK+="cdrom5", ENV{GENERATED}="1"
>
> LITE-ON_COMBO_SOHC-5236K is my internal drive, which SHOULD be mapped
> to /dev/cdrom. But it's not:
>
> camille rules.d # ls /dev/cdrom
> ls: cannot access /dev/cdrom: No such file or directory

Check also /dev/cdrom*. Maybe it got another name, as there are at least
three rules to symlink that drive (if it matched all rules, udev would
create the three links, but the third rule looks different).

> Why is it not being mapped correctly? Is the rule above not correct?
> I've tried to read tutorials about writing udev rules, but the example
> rules in the tutorials look nothing like the above rules, and I didn't
> write those. I think they were created when udev was installed...

--
Nuno J. Silva
gopher://sdf-eu.org/1/users/njsg


All times are GMT. The time now is 11:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.