# Problem with IDE cdrom [solved]

## at

I had a perfectly working CDROM (LITE-ON SOHC-5236V), that is until I tried to use it with K3b.

Ever since, I cannot access the CDROM device anymore (/dev/cdrom) (using KAudioCreator, for example).

The errors I get in /var/log/kernel.log are:

```

hda: status error: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

hda: drive not ready for command

```

Even 'eject /dev/cdrom' by root does not work.

Would you have any suggestions?

Thank youLast edited by at on Tue Aug 14, 2007 4:45 am; edited 3 times in total

----------

## NathanZachary

Have you tried unmerging k3b and seeing if you regain access to the drive?  Does the drive function within k3b?

----------

## at

No, the drive doesn't work with K3b either now.

Unmerged K3b - no effect.

I think when I was running K3b Setup it changed something with that drive.

----------

## NathanZachary

Can you please post your fstab?

----------

## at

/etc/fstab:

```
/dev/sda1       /boot           reiserfs        ro,noauto,noatime,notail,nouser 1 2

/dev/sda2       none            swap            sw              0 0

/dev/sda3       /               reiserfs        noatime,notail  0 1

/dev/cdrom      /mnt/cdrom      auto            rw,noauto,user,group    0 0

proc            /proc           proc            defaults        0 0

shm             /dev/shm        tmpfs           nodev,nosuid,noexec     0 0
```

```
# ls -l /dev/cdrom

lrwxrwxrwx 1 root root 3 2007-07-18 03:50 /dev/cdrom -> hda
```

```
# ls -l /dev/hda

brw-rw---- 1 root cdrom 3, 0 2007-07-18 03:50 /dev/hda
```

----------

## NathanZachary

Do you have HAL and D-BUS installed?

----------

## at

No HAL:

```
# equery l hal

[ Searching for package 'hal' in all categories among: ]

 * installed packages

[I--] [  ] app-crypt/hashalot-0.3-r2 (0)
```

Since I don't know what D-BUS is, then probably not either. Do you know how I could check for sure?

----------

## NathanZachary

What I would do is emerge HAL:

```

emerge sys-apps/hal

```

Then D-BUS

```

emerge sys-apps/dbus

```

Once those are successfully merged, add them to the default runlevel:

```

rc-update add hald default && rc-update add dbus default

```

Then, comment out the line for your optical drive in the fstab:

```

#/dev/cdrom      /mnt/cdrom      auto            rw,noauto,user,group    0 0

```

Lastly, reboot your machine.  That should take care of your problem.  :Smile: 

----------

## at

I suppose, it could be one solution. But my goal was to make my CDROM, which _did_ work perfectly well without HAL, until I was unfortunate to start K3bSetup, to work again.

The solution is:

```
hdparm -w /dev/hda
```

In fact, it is very reproducible: Run K3bSetup - CDROM becomes unusable. Run the command above - you can use the CDROM again.Last edited by at on Tue Jul 24, 2007 12:22 am; edited 1 time in total

----------

## NathanZachary

Aha!  That is a nice little trick.  I've never had that problem with K3B, but I guess it is a known bug.

----------

## Theophile

Nice, helped me too. Will this keep the problem from occurring in the first place?

----------

## at

Actually, this is not solved.

The problem keeps reoccurring. The CDROM allows to rip 2 - 3 CDs and then starts giving the same errors.

'hdparm -v /dev/cdrom' helps a couple of times, but then crashes the kernel.

The problem doesn't seem to be specific to the CDROM. Now, when I use an external DVD drive (USB-connected), I do not see anything on the CD inserted in that drive either.

Testing CDROM with cdparanoia after it breaks gives the following:

```
$ cdparanoia -vQ

cdparanoia III release 9.8 (March 23, 2001)

(C) 2001 Monty <monty@xiph.org> and Xiphophorus

Report bugs to paranoia@xiph.org

http://www.xiph.org/paranoia/

Checking /dev/cdrom for cdrom...

        Testing /dev/cdrom for cooked ioctl() interface

                Device /dev/hda is not a CDROM

        Testing /dev/cdrom for SCSI interface

                /dev/cdrom is not a SCSI device
```

Testing the same drive before it breaks (that is after a reboot), works fine and displays a list of tracks.

Any ideas?

----------

## NathanZachary

Are you using the stable branch, testing branch, or mixing the two?  If you are mixing, what versions are you using of K3b and all associated libs?

----------

## at

I am using the stable branch - app-cdr/k3b-0.12.17, media-sound/cdparanoia-3.9.8-r5.

But now, after K3bSetup has done its malicious deed, the drives don't work with any application, not just k3b.

Evidently, K3bSetup has changed some global setting, but I have no clue which one.

Some parameter on some kernel module?

----------

## Vlad

What kernel and IDE chipset are you using? What IDE-related drivers did you configure in the kernel?  Are you using an experiment PATA driver from the new ATA code?

----------

## at

The kernel is 2.6.21-hardened-r3.

lspci -v:

```

00:04.0 IDE interface: nVidia Corporation MCP55 IDE (rev a1) (prog-if 8a [Master SecP PriP])

        Subsystem: nVidia Corporation Unknown device cb84

        Flags: bus master, 66MHz, fast devsel, latency 0

        [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [disabled] [size=8]

        [virtual] Memory at 000003f0 (type 3, non-prefetchable) [disabled] [size=1]

        [virtual] Memory at 00000170 (32-bit, non-prefetchable) [disabled] [size=8]

        [virtual] Memory at 00000370 (type 3, non-prefetchable) [disabled] [size=1]

        I/O ports at f400 [size=16]

        Capabilities: [44] Power Management version 2

00:05.1 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a2) (prog-if 85 [Master SecO PriO])

        Subsystem: nVidia Corporation Unknown device cb84

        Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 11

        I/O ports at 09e0 [size=8]

        I/O ports at 0be0 [size=4]

        I/O ports at 0960 [size=8]

        I/O ports at 0b60 [size=4]

        I/O ports at cc00 [size=16]

        Memory at fe02c000 (32-bit, non-prefetchable) [size=4K]

        Capabilities: [44] Power Management version 2

        Capabilities: [b0] Message Signalled Interrupts: Mask- 64bit+ Queue=0/2 Enable-

        Capabilities: [cc] HyperTransport: MSI Mapping

00:05.2 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a2) (prog-if 85 [Master SecO PriO])

        Subsystem: nVidia Corporation Unknown device cb84

        Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 5

        I/O ports at c800 [size=8]

        I/O ports at c400 [size=4]

        I/O ports at c000 [size=8]

        I/O ports at bc00 [size=4]

        I/O ports at b800 [size=16]

        Memory at fe02b000 (32-bit, non-prefetchable) [size=4K]

        Capabilities: [44] Power Management version 2

        Capabilities: [b0] Message Signalled Interrupts: Mask- 64bit+ Queue=0/2 Enable-

        Capabilities: [cc] HyperTransport: MSI Mapping

```

Here is an excerpt from kernel.log:

```

Jul 23 22:47:12 localhost Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

Jul 23 22:47:12 localhost ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

Jul 23 22:47:12 localhost NFORCE-MCP55: IDE controller at PCI slot 0000:00:04.0

Jul 23 22:47:12 localhost NFORCE-MCP55: chipset revision 161

Jul 23 22:47:12 localhost NFORCE-MCP55: not 100% native mode: will probe irqs later

Jul 23 22:47:12 localhost NFORCE-MCP55: 0000:00:04.0 (rev a1) UDMA133 controller

Jul 23 22:47:12 localhost ide0: BM-DMA at 0xf400-0xf407, BIOS settings: hda:DMA, hdb:DMA

Jul 23 22:47:12 localhost Probing IDE interface ide0...

Jul 23 22:47:12 localhost hda: LITE-ON COMBO SOHC-5236V, ATAPI CD/DVD-ROM drive

Jul 23 22:47:12 localhost ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Jul 23 22:47:12 localhost Probing IDE interface ide1...

Jul 23 22:47:12 localhost hda: ATAPI 52X DVD-ROM CD-R/RW drive, 1536kB Cache, UDMA(33)

Jul 23 22:47:12 localhost Uniform CD-ROM driver Revision: 3.20
```

I am not using PATA, but:

```

<*> ATA/ATAPI/MFM/RLL support

<*>   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support

<*>     Include IDE/ATA-2 DISK support

<*>     generic/default IDE chipset support

[*]     PCI IDE chipset support

[*]       Generic PCI bus-master DMA support

<*>         AMD and nVidia IDE support

```

Here is what I get from hdparm

```

# hdparm --verbose /dev/cdrom

/dev/cdrom:

 IO_support    =  1 (32-bit)

 unmaskirq     =  1 (on)

 using_dma     =  1 (on)

 keepsettings  =  0 (off)

 readonly      =  0 (off)

 readahead     = 256 (on)

 HDIO_GETGEO failed: Inappropriate ioctl for device

```

To summarise, the symptoms are that the drive worked fine with this configuration before.

After something has been modified by K3bSetup, the drive works only after a reboot and then stops working after 1 - 3 CDs. If I reboot, it will work again for 1 -3 CDs and then will stop.

Thank you!

----------

## at

Switching to PATA drivers solved the problem: https://forums.gentoo.org/viewtopic-p-4174558.html#4174558

----------

