# special device /dev/cdrom does not exist

## Wizumwalt

I'm trying to mount a cd as follows:

```

# mount -t iso9660 /dev/cdrom /mnt/cdrom

mount: special device /dev/cdrom does not exist

```

In my /etc/fstab I have:

```

/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro       0 0

```

'ls -l' in /dev/ shows no devices or directories beginning with cd*.

Any help much appreciated.

----------

## xoomix

Do you have udev emerged? And if so, have you gone through and edited your /etc/udev/rules.d/50-udev.rules file to make sure it creates the cdrom devices/links ?

----------

## wynn

Check your /var/log/messages, it may be known as /dev/hda or /dev/hdb.

For example

```
Nov 15 14:52:02 lightfoot     ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:pio

Nov 15 14:52:02 lightfoot     ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:pio

Nov 15 14:52:02 lightfoot hda: Pioneer DVD-ROM ATAPIModel DVD-116 0109, ATAPI CD/DVD-ROM drive

Nov 15 14:52:02 lightfoot hdb: PIONEER DVD-RW DVR-111, ATAPI CD/DVD-ROM drive

Nov 15 14:52:02 lightfoot ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Nov 15 14:52:02 lightfoot hda: ATAPI 40X DVD-ROM drive, 256kB Cache, UDMA(66)

Nov 15 14:52:02 lightfoot Uniform CD-ROM driver Revision: 3.20

Nov 15 14:52:02 lightfoot hdb: ATAPI 40X DVD-ROM DVD-R-RAM CD-R/RW drive, 2000kB Cache, UDMA(66)
```

and

```
# ls -l /dev/hd[ab]

brw-rw---- 1 root cdrom 3,  0 Nov 15 14:51 /dev/hda

brw-rw---- 1 root cdrom 3, 64 Nov 15 14:51 /dev/hdb

# ls -l /dev/cdrom

lrwxrwxrwx 1 root root 3 Nov 15 14:51 /dev/cdrom -> hda
```

----------

## Wizumwalt

Yes, udev is emerged.

In /dev/udev/rules.d/50-udev.rules I found:

```

BUS=="ide",     KERNEL=="hd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"

BUS=="scsi",    KERNEL="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"

BUS=="scsi",    KERNEL="scd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"

BUS=="scsi",    KERNEL="sg[0-9]*", ACTION=="add", DRIVER=="sr", GROUP="cdrom"

ENV{ID_CDROM}=="?*",            SYMLINK+="cdrom%e", GROUP="cdrom"

ENV{ID_CDROM_CD_RW}=="?*",      SYMLINK+="cdrw%e"

ENV{ID_CDROM_DVD}=="?*",        SYMLINK+="dvd%e"

ENV{ID_CDROM_DVD_R}=="?*",      SYMLINK+="dvdrw%e"

```

From the rules I saw the section sg[0-9] so I found this in the dmesg.

```

# dmesg | grep -i sg 

SGI XFS with no debug enabled

 0:0:6:0: Attached scsi generic sg0 type 3

sd 0:2:0:0: Attached scsi generic sg1 type 0

```

I know my hd partitions are sda[0-10] and since I can't find any cd* in the dmesg, I'm guessing it's sg0 or sg1. Is that correct, and if so, how do I make the device for it? And would it be /dev/cdroms/cdrom0 as in the fstab?

----------

## xoomix

does 'dmesg |grep -i cd' return anything that looks to be your cdrom drive?

----------

## Wizumwalt

I think it must be scsi, so I just see this ...

```

 # dmesg | grep -i cd

Linux version 2.6.17-gentoo-r8 (root@livecd) (gcc version 4.1.1 (Gentoo 4.1.1)) #1 SMP Thu Oct 5 13:29:55 Local time zone must be set--see zic m

ACPI: RSDP (v000 DELL                                  ) @ 0x000fcd80

ACPI: RSDT (v001 DELL   PE68x0   0x00000001 MSFT 0x0100000a) @ 0x000fcd94

ehci_hcd 0000:00:1d.7: EHCI Host Controller

ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1

ehci_hcd 0000:00:1d.7: debug port 1

ehci_hcd 0000:00:1d.7: irq 20, io mem 0xdff00000

ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004

uhci_hcd 0000:00:1d.0: UHCI Host Controller

uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2

uhci_hcd 0000:00:1d.0: irq 16, io base 0x00006ce0

usb 1-3: new high speed USB device using ehci_hcd and address 2

uhci_hcd 0000:00:1d.1: UHCI Host Controller

uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3

uhci_hcd 0000:00:1d.1: irq 21, io base 0x00006cc0

uhci_hcd 0000:00:1d.2: UHCI Host Controller

uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4

uhci_hcd 0000:00:1d.2: irq 22, io base 0x00006ca0

usb 1-3.1: new low speed USB device using ehci_hcd and address 3

```

----------

## xoomix

Ok so my guess right now is that you don't have the proper SCSI stuff built into the kernel for cdrom support. Comb through your kernel config file and grep out anything SCSI and cdrom related, and post those values (Y/M/N) here.

----------

## Wizumwalt

Ok, here's the relevent .config sections ...

```

# CONFIG_BLK_DEV_IDE_SATA is not set

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=y

# CONFIG_IDEDISK_MULTI_MODE is not set

CONFIG_BLK_DEV_IDECD=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

# CONFIG_BLK_DEV_IDESCSI is not set

# CONFIG_IDE_TASK_IOCTL is not set

...

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

# CONFIG_CHR_DEV_ST is not set

# CONFIG_CHR_DEV_OSST is not set

# CONFIG_BLK_DEV_SR is not set

CONFIG_CHR_DEV_SG=y

# CONFIG_CHR_DEV_SCH is not set

...

# USB Host Controller Drivers

#

CONFIG_USB_EHCI_HCD=y

# CONFIG_USB_EHCI_SPLIT_ISO is not set

# CONFIG_USB_EHCI_ROOT_HUB_TT is not set

# CONFIG_USB_ISP116X_HCD is not set

# CONFIG_USB_OHCI_HCD is not set

CONFIG_USB_UHCI_HCD=y

# CONFIG_USB_SL811_HCD is not set

...

#

# CD-ROM/DVD Filesystems

#

CONFIG_ISO9660_FS=y

CONFIG_JOLIET=y

CONFIG_ZISOFS=y

CONFIG_ZISOFS_FS=y

# CONFIG_UDF_FS is not set

```

----------

## xoomix

Is it an IDE or SCSI cdrom?

----------

## Wizumwalt

I believe it's a scsi. The machine is a dell 6850 and the hard drives are scsi.

----------

## xoomix

Ok let's assume you have a SCSI cdrom then - you'll need to change your kernel config to reflect that.

This section:

CONFIG_BLK_DEV_IDE_SATA is not set

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=y

# CONFIG_IDEDISK_MULTI_MODE is not set

CONFIG_BLK_DEV_IDECD=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

# CONFIG_BLK_DEV_IDESCSI is not set

# CONFIG_IDE_TASK_IOCTL is not set 

for sure looks incorrect, as you don't have an IDE cdrom.

----------

## graphicsMan

Hey guys -

I'm also having trouble finding my cdrom.  Mine is an ATAPI DVD/CD drive (judging by the install CD's dmesg output).  Unfortunately I've tried all kinds of combinations of SATA and ATAPI/IDE drivers in the kernel, but I just can't get my drive to show up in /dev (no hda, hdb, hdc, no scd, no cdrom).

Machine is a Sony Vaio, chipset is Intel ICH7.  With the exception of occasional flakiness on the part of the wireless, machine is working great.  Just no cd/dvd drive.

from my .config:

```

#

# ATA/ATAPI/MFM/RLL support

#

CONFIG_IDE=y

CONFIG_BLK_DEV_IDE=y

#

# Please see Documentation/ide.txt for help/info on IDE drives

#

# CONFIG_BLK_DEV_IDE_SATA is not set

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=y

CONFIG_IDEDISK_MULTI_MODE=y

# CONFIG_BLK_DEV_IDECS is not set

CONFIG_BLK_DEV_IDECD=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

# CONFIG_BLK_DEV_IDESCSI is not set

# CONFIG_IDE_TASK_IOCTL is not set

#

# IDE chipset support/bugfixes

#

CONFIG_IDE_GENERIC=y

# CONFIG_BLK_DEV_CMD640 is not set

# CONFIG_BLK_DEV_IDEPNP is not set

CONFIG_BLK_DEV_IDEPCI=y

# CONFIG_IDEPCI_SHARE_IRQ is not set

# CONFIG_BLK_DEV_OFFBOARD is not set

CONFIG_BLK_DEV_GENERIC=y

# CONFIG_BLK_DEV_OPTI621 is not set

# CONFIG_BLK_DEV_RZ1000 is not set

CONFIG_BLK_DEV_IDEDMA_PCI=y

# CONFIG_BLK_DEV_IDEDMA_FORCED is not set

CONFIG_IDEDMA_PCI_AUTO=y

# CONFIG_IDEDMA_ONLYDISK is not set

# CONFIG_BLK_DEV_AEC62XX is not set

# CONFIG_BLK_DEV_ALI15X3 is not set

# CONFIG_BLK_DEV_AMD74XX is not set

# CONFIG_BLK_DEV_ATIIXP is not set

# CONFIG_BLK_DEV_CMD64X is not set

# CONFIG_BLK_DEV_TRIFLEX is not set

# CONFIG_BLK_DEV_CY82C693 is not set

# CONFIG_BLK_DEV_CS5520 is not set

# CONFIG_BLK_DEV_CS5530 is not set

# CONFIG_BLK_DEV_CS5535 is not set

# CONFIG_BLK_DEV_HPT34X is not set

# CONFIG_BLK_DEV_HPT366 is not set

# CONFIG_BLK_DEV_SC1200 is not set

CONFIG_BLK_DEV_PIIX=y

# CONFIG_BLK_DEV_IT821X is not set

# CONFIG_BLK_DEV_NS87415 is not set

# CONFIG_BLK_DEV_PDC202XX_OLD is not set

# CONFIG_BLK_DEV_PDC202XX_NEW is not set

# CONFIG_BLK_DEV_SVWKS is not set

# CONFIG_BLK_DEV_SIIMAGE is not set

# CONFIG_BLK_DEV_SIS5513 is not set

# CONFIG_BLK_DEV_SLC90E66 is not set

# CONFIG_BLK_DEV_TRM290 is not set

# CONFIG_BLK_DEV_VIA82CXXX is not set

# CONFIG_IDE_ARM is not set

CONFIG_BLK_DEV_IDEDMA=y

# CONFIG_IDEDMA_IVB is not set

CONFIG_IDEDMA_AUTO=y

# CONFIG_BLK_DEV_HD is not set

```

and

```

CONFIG_BLK_DEV_SR_VENDOR=y

# CONFIG_CHR_DEV_SG is not set

# CONFIG_CHR_DEV_SCH is not set

#

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs

#

CONFIG_SCSI_MULTI_LUN=y

# CONFIG_SCSI_CONSTANTS is not set

# CONFIG_SCSI_LOGGING is not set

#

# SCSI Transport Attributes

#

# CONFIG_SCSI_SPI_ATTRS is not set

# CONFIG_SCSI_FC_ATTRS is not set

# CONFIG_SCSI_ISCSI_ATTRS is not set

# CONFIG_SCSI_SAS_ATTRS is not set

#

# SCSI low-level drivers

#

# CONFIG_ISCSI_TCP is not set

# CONFIG_BLK_DEV_3W_XXXX_RAID is not set

# CONFIG_SCSI_3W_9XXX is not set

# CONFIG_SCSI_ACARD is not set

# CONFIG_SCSI_AACRAID is not set

# CONFIG_SCSI_AIC7XXX is not set

# CONFIG_SCSI_AIC7XXX_OLD is not set

# CONFIG_SCSI_AIC79XX is not set

# CONFIG_SCSI_DPT_I2O is not set

# CONFIG_SCSI_ADVANSYS is not set

# CONFIG_MEGARAID_NEWGEN is not set

# CONFIG_MEGARAID_LEGACY is not set

# CONFIG_MEGARAID_SAS is not set

CONFIG_SCSI_SATA=y

CONFIG_SCSI_SATA_AHCI=y

# CONFIG_SCSI_SATA_SVW is not set

CONFIG_SCSI_ATA_PIIX=y

# CONFIG_SCSI_SATA_MV is not set

# CONFIG_SCSI_SATA_NV is not set

# CONFIG_SCSI_PDC_ADMA is not set

# CONFIG_SCSI_HPTIOP is not set

# CONFIG_SCSI_SATA_QSTOR is not set

# CONFIG_SCSI_SATA_PROMISE is not set

# CONFIG_SCSI_SATA_SX4 is not set

# CONFIG_SCSI_SATA_SIL is not set

# CONFIG_SCSI_SATA_SIL24 is not set

# CONFIG_SCSI_SATA_SIS is not set

# CONFIG_SCSI_SATA_ULI is not set

# CONFIG_SCSI_SATA_VIA is not set

# CONFIG_SCSI_SATA_VITESSE is not set

CONFIG_SCSI_SATA_INTEL_COMBINED=y

```

dmesg  (dmesg | egrep -i ata | egrep -v data) on install CD gives me:

```

hda: MATSHITAUJ-842D, ATAPI CD/DVD-ROM drive

hda: ATAPI 24X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33)

libata version 1.20 loaded.

ata_piix 0000:00:1f.2: version 1.05

ata_piix 0000:00:1f.2: MAP [ P0 P2 XX XX ]

ata_piix 0000:00:1f.2: invalid MAP value 0

ata1: SATA max UDMA/133 cmd 0x18C8 ctl 0x18AE bmdma 0x18B0 irq 21

ata2: SATA max UDMA/133 cmd 0x18C0 ctl 0x18AA bmdma 0x18B8 irq 21

ata1: dev 0 cfg 49:2f00 82:346b 83:7d09 84:6003 85:3469 86:3c09 87:6003 88:207f

ata1: dev 0 ATA-7, max UDMA/133, 156301488 sectors: LBA48

ata1: dev 0 configured for UDMA/133

scsi0 : ata_piix

ata2: SATA port has no device.

scsi1 : ata_piix

  Vendor: ATA       Model: ST98823AS         Rev: 3.14

```

and with my kernel gives:

```

Kernel command line: root=/dev/sda3 libata.atapi_enabled=1

libata version 2.00 loaded.

ata_piix 0000:00:1f.2: version 2.00

ata_piix 0000:00:1f.2: MAP [ P0 P2 XX XX ]

ata_piix 0000:00:1f.2: invalid MAP value 0

ata1: SATA max UDMA/133 cmd 0x18C8 ctl 0x18AE bmdma 0x18B0 irq 21

ata2: SATA max UDMA/133 cmd 0x18C0 ctl 0x18AA bmdma 0x18B8 irq 21

scsi0 : ata_piix

ata1.00: ATA-7, max UDMA/133, 156301488 sectors: LBA48 NCQ (depth 0/32)

ata1.00: ata1: dev 0 multi count 16

ata1.00: configured for UDMA/133

scsi1 : ata_piix

ATA: abnormal status 0x7F on port 0x18C7

  Vendor: ATA       Model: ST98823AS         Rev: 3.14

```

Any ideas?

Thanks,

  Brian

----------

## xoomix

Do you have the following set the same in your /dev/udev/rules.d/50-udev.rules ?

# cdrom symlinks and other good cdrom naming

BUS=="ide",     KERNEL=="hd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"

BUS=="scsi",    KERNEL="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"

BUS=="scsi",    KERNEL="scd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"

BUS=="scsi",    KERNEL="sg[0-9]*", ACTION=="add", DRIVER=="sr", GROUP="cdrom"

ENV{ID_CDROM}=="?*",            SYMLINK+="cdrom%e", GROUP="cdrom"

ENV{ID_CDROM_CD_RW}=="?*",      SYMLINK+="cdrw%e"

ENV{ID_CDROM_DVD}=="?*",        SYMLINK+="dvd%e"

ENV{ID_CDROM_DVD_R}=="?*",      SYMLINK+="dvdrw%e"

The kernel clearly shows your cdrom drive as /dev/hda

----------

## graphicsMan

my udev rules live in /etc, but other than that, yes, it looks exactly like that.

Thanks,

   Brian

----------

## xoomix

Does your /etc/udev/udev.conf file show the correct path to your rules like so:

udev_rules="/etc/udev/rules.d/" (or whatever your path is, if right under /etc)

----------

## graphicsMan

udev_root="/dev/"

udev_rules="/etc/udev/rules.d/"

Seems okay.

----------

## xoomix

Have you ever installed hotplug/coldplug and added that to your boot runlevel and restarted? Hmm I am digging now

check by 'rc-status boot' and see if coldplug is there and active.

----------

## graphicsMan

I have hotplug, but it's not started automatically at any runlevel.  I don't have coldplug.

Is it necessary to have one or both of these?

Thanks,

  Brian

----------

## xoomix

Hmmm I don't now if one of these is *required* or not - would you be willing to add hotplug and coldplug both to your boot runlevel and tell us what happens after a reboot?

----------

## graphicsMan

I'll try hotplug... it looks like coldplug and udev aren't happy together.

----------

## xoomix

For what it's worth:

http://www.gentoo.org/doc/en/udev-guide.xml

Lotta info in there, down to how to make the kernel correctly to support this. Start from the beginning  :Smile: 

----------

## graphicsMan

Thanks for all the ideas so far.  Unfortunately, still no progress on my front.

If I can't figure this out soon, I might have to use genkernel (which I usually shy away from), since obviously the install CD works.

It just seems crazy... I've never had a problem before with any of my systems finding the CD drive.

----------

## wynn

 *graphicsMan wrote:*   

> Thanks for all the ideas so far.  Unfortunately, still no progress on my front.
> 
> If I can't figure this out soon, I might have to use genkernel (which I usually shy away from), since obviously the install CD works.
> 
> It just seems crazy... I've never had a problem before with any of my systems finding the CD drive.

 genkernel is promoted as the way to get a kernel without having to know much about your hardware.

If you know how to configure a kernel, you can do this outside genkernel  â which allows you a second go if you change your mind without having to wait for the kernel to be compiled or kill genkernel.

You can then use the resulting .config by running genkernel with the --oldconfig argument. If the kernel has already been compiled, you might want to run genkernel with the --clean option but it would be wise to save the .config before running genkernel anyway. If you run genkernel with --mrproper it will do the same as "clean" but the .config file will be removed as well.

So now you have a custom kernel.

You also have an initrd file, in this case an initramfs file. All kernels from 2.5.<something> start an initramfs and (according to  Documentation/early-userspace/README) the code now in the kernel to mount the root filesystem will eventually be moved to an initramfs, so some form of it, either as an initrd or compiled into the kernel is in all our futures.

From this it looks as though genkernel will move from being the "n00b's lifeline" to the standard way to compile a kernel.

----------

