# Can't mount cdrom (no device in /dev)

## GastonSpronck

Recently I reinstalled Gentoo on my laptop. While doing this I upgraded the kernel from gentoo-sources-2.6.25-r9 to gentoo-sources-2.6.31-r6. 

The problem is that the system doesn't see the cdrom at all, there is no device in /dev. In my previous intallation (which still exists in another partition) it shows up as /dev/sr0, but the gentoo live-cd calls it /dev/hda.

I configured the new kernel much like the old one (in terms of SATA and SCSI as close as I could get) and I tried various other options, but non of these worked. To downgrade back to gentoo-sources-2.6.25-r9 is no option because udev seems not to like this kernel version.

 *Quote:*   

> 
> 
> lspci:
> 
> 00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
> ...

 

Any ideas how I can fix this?

----------

## HeadbangingMan

Can you please post the output of

```
dmesg | grep [^h]cd
```

and the contents of /etc/udev/rules.d/70-persistent-cd.rules (if any).

----------

## GastonSpronck

 *Quote:*   

> 

 

dmesg | grep [^h]cd:

ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.RP02.PXS2._STA] (Node f7034cd4), AE_ERROR

ACPI Error (uteval-0256): Method execution failed [\_SB_.PCI0.RP02.PXS2._STA] (Node f7034cd4), AE_ERROR

ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.RP02.PXS2._STA] (Node f7034cd4), AE_ERROR

ACPI Error (uteval-0256): Method execution failed [\_SB_.PCI0.RP02.PXS2._STA] (Node f7034cd4), AE_ERROR

[/quote]

----------

## HeadbangingMan

I'm quite sure it's a missing option in your kernel config. Maybe

```
grep CONFIG_BLK_DEV_IDECD /usr/src/linux/.config
```

It's set to y on my system.

----------

## cach0rr0

howdy

this is the interface we need to find the driver for

```

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 

```

could you post your lspci -n output in here? 

I'm pretty sure that one uses CONFIG_ATA_PIIX

If you go under the "Serial ATA (prod) and Parallel ATA (experimental) drivers", check for "Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support"

It will not be visible unless you've already selected "ATA SFF support"

do all of the above as built-in rather than as modules

EDIT: I should also point out, make sure you aren't using the old IDE drivers, or there will be conflicts on ICH7

Meaning you should NOT have this selected

```
ATA/ATAPI/MFM/RLL support
```

And you SHOULD have this selected:

```
<*> Serial ATA (prod) and Parallel ATA (experimental) drivers
```

All of the drivers you need for both your hard disk and your CD drive should be under the latter of the aforementioned

----------

## GastonSpronck

First my lscpi -n:

 *Quote:*   

> 
> 
> 00:00.0 0600: 8086:27a0 (rev 03)
> 
> 00:02.0 0300: 8086:27a2 (rev 03)
> ...

 

I recompiled my kernel with CONFIG_BLK_DEV_IDECD and CONFIG_ATA_PIIX switched on. I tried this before, but a gave it another chance. After this I recompiled the kernel with CONFIG_BLK_DEV_SR (scsi cdrom) turned off, but also nothing.

I really don't get it, on my old installation (gentoo-sources-2.6.25-r9) my cdrom drive simply worked without CONFIG_BLK_DEV_IDECD

----------

## VoidMage

For CONFIG_ATA you'll want CONFIG_BLK_DEV_SR, even if it's IDE.

Also, if your pciutils are 3.1.4 (recently stabled), what's the output of

'lspci -k' ?

----------

## GastonSpronck

I updated pciutils to version 3.1.4

my lspci -k output:

 *Quote:*   

> 
> 
> 00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
> 
> 	Subsystem: Hewlett-Packard Company Device 30bb
> ...

 

----------

## cach0rr0

Yeah, that should be very well supported. 

And we know it's ATA_PIIX that you need

do a 

```
grep -ir 0x27df /usr/src/linux/drivers/ata
```

 and you'll see what I mean. 

If it's flat-out refusing to show up, I can't help but think something else is conflicting - can you dump your .config up on pastebin?

----------

## GastonSpronck

grep -ir 0x27df /usr/src/linux/drivers/ata:

 *Quote:*   

> 
> 
> /usr/src/linux/drivers/ata/ata_piix.c:	{ 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100_nomwdma1 },
> 
> /usr/src/linux/drivers/ata/ata_piix.c:	{ 0x27DF, 0x0005, 0x0280 },	/* ICH7 on Acer 5602WLMi */
> ...

 

----------

## cach0rr0

I just meant that you should try that quickie grep so you could see what I mean  :Razz: 

Rather that we know it's ata_piix we should be using. 

Mainly interested in seeing your kernel configuration (on pastebin preferably, as that keeps the forum more readable!)

----------

## GastonSpronck

My .config can be found on:

http://pastebin.com/m44011af5

----------

## cach0rr0

perfect

ok, so looking at your config, I see this which is problematic:

```

CONFIG_IDE=y

```

That corresponds to "ATA/ATAPI/MFM/RLL support"

You should untick this. IDE is handled now by the new PATA drivers under  <*> Serial ATA (prod) and Parallel ATA (experimental) drivers, and on ICH chipsets having both is pretty much a guarantee to end up with conflicts. 

So go ahead and go back in to menuconfig, and untick "ATA/ATAPI/MFM/RLL support" completely - not just each item beneath it, I mean deselect it completely. 

You already have the necessary driver selected within the new drivers - see comments inline:

```

CONFIG_ATA=y //this is "Serial ATA (prod) and Parallel ATA (experimental) drivers. You DO want this, so this is perfect

# CONFIG_ATA_NONSTANDARD is not set

# CONFIG_ATA_ACPI is not set

# CONFIG_SATA_PMP is not set

CONFIG_SATA_AHCI=y //this will handle your hard disks, so this is perfect

# CONFIG_SATA_SIL24 is not set

CONFIG_ATA_SFF=y //this enables you to select the correct PATA driver for your CDROM, so this is perfect

# CONFIG_SATA_SVW is not set

CONFIG_ATA_PIIX=m //this is the correct PATA driver for your cdrom. I would change this to =y instead of =m

```

So the only two real changes to make:

-completely deselect ATA/ATAPI/MFM/RLL support

-change ATA_PIIX to be =y (built-in) rather than =m (module)

Once you changed that, rebuild your kernel and install as per usual. 

Your device will now show up as /dev/sr0 rather than /dev/hd* (the latter is nomenclature for the old IDE driver set)

If you are having trouble accessing your cdrom by symbolic names like /dev/cdrom or /dev/cdrw (some apps might expect that), you need to look at your udev rules under /etc/udev/rules.d/70-persistent-cd.rules.

----------

## GastonSpronck

I made the changes to the kernel, but the cdrom still doesn't show up.

----------

## cach0rr0

im assuming you rebooted into your newly built kernel already, yes? 

if so, post the following:

-your new kernel .config (on pastebin of course)

-output of the following commands

```

ls -alh /dev/sr0

lspci -k

```

I want to see if /dev/sr0 shows up, and if lspci -k now shows the driver as being in use.

----------

## GastonSpronck

My current kernel config can be found here:

 *Quote:*   

> 
> 
> http://pastebin.com/m63b9f0f5
> 
> 

 

I did ls -alh /dev/sr0 and there is really no such device

The output of lspci -k was exactly the same as the one shown above, I conpared the two with diff

Maybe this can help us further:

 *Quote:*   

> 
> 
> Output of dmseg | grep ata:
> 
>   #0 [0000000000 - 0000001000]   BIOS data page ==> [0000000000 - 0000001000]
> ...

 

I also compared the ata_piix.c files of the .31 kernel with the .25 (which simply supports met cdrom drive) and there are differences. I guess that my current ata_piix needs some kind of boot parameter or that there is a bug in the ata_piix.c.[/code]

----------

## depontius

I had this exact problem a little bit back - see this thread : https://forums.gentoo.org/viewtopic-t-808618-highlight-.html

Like you, I had /dev/sr0, but none of the more conventionally named symlinks.  It turned out to be a kernel configuration issue.  For best backwards compatibility I've been building my kernels with CONFIG_SYSFS_DEPRECATED=y for some time.  A quick peek in your logs and you'll find that udev-146 just doesn't like that at all.  For udev-146 and beyond, you need to unset CONFIG_FS_DEPRECATED.  That's what stops the symlinks from being properly made.

I had a second problem that was more specifically audio, and that was because the "cdaudio" USE flag was dropped in favor of "cdda".  Tweak my USE flags, emerge with the "UD" flags, and all was well.

----------

## cach0rr0

 *depontius wrote:*   

> I had this exact problem a little bit back - see this thread : https://forums.gentoo.org/viewtopic-t-808618-highlight-.html
> 
> Like you, I had /dev/sr0,.

 

He doesn't even have a /dev/sr0  :Razz: 

 *Quote:*   

> 
> 
> I did ls -alh /dev/sr0 and there is really no such device
> 
> 

 

His driver setup looks fine, so I'm at a loss honestly.

----------

## depontius

 *cach0rr0 wrote:*   

> He doesn't even have a /dev/sr0 

 

Missed that.  Oops

 *cach0rr0 wrote:*   

> His driver setup looks fine, so I'm at a loss honestly.

 

These things kind of bug me out of his dmesg...

```
PCI: Fatal: No config space access function found 

...

ata_piix 0000:00:1f.1: device not available because of BAR 0 [0x1f0-0x1f7] collisions

ata_piix: probe of 0000:00:1f.1 failed with error -22 
```

I suspect that's significant, though I don't know in detail what they mean.

----------

## cach0rr0

try adding "acpi=off" to your kernel command line (grub.conf)

reboot, same kernel, see if it shows up

----------

## GastonSpronck

acpi=off also doesn't work

I will try to downgrade to the .30-r8 version (the same as the live-cd which uses the cd-drive under /dev/hda)

----------

## GastonSpronck

I downgraded my kernel to the .30-r8 version and I used a kernel-seed and guess what, my cdrom drive works. It listens to the name /dev/hda (/dev/cdrom or /dev/cdrw).

Thanks for your help !

----------

## depontius

Rings a little bell...

Next time you boot, go into your BIOS and see if in the "onboard peripherals" section there's something about "AHCI".  In moving back to the earlier kernel you've gone back to the IDE support.  That stuff is being deemphasized and new development is happening on libata, which runs IDE devices through the SCSI stack.  A year or two back I remember seeing something about whether or not to use AHCI as an optional driver for certain controller hardware, and that there may be problems with some hardware/driver combinations, and that BIOS setting tweaks may be necessary.  IIRC, some of the problems may have involved hardware autodetection, and heading in the wrong direction when the BIOS hadn't been set to match.  It's all rather fuzzy now.

IDE works for now, but in the very long term it's going away, and not much is happening with it beyond bug fixes.  But then again, it may outlast the current hardware you're concerned with.

----------

