Go to TogaWare.com Home Page.
GNU/Linux Desktop Survival Guide
by Graham Williams
Google

SATA CD/DVD


The CD/DVD drive is attached to the SATA, and support for this in the 2.6.16 kernel requires setting atapi_enabled=1 for libata. The default, after my installation, was to load ide-generic, and when this is loaded the IDE is trying to get hold of the devices already claimed by ATA, and we get the message:

  $ sudo modeprobe ide-generic
  $ demsg | tail -4 
  ide0: I/O resource 0x1F0-0x1F7 not free.
  ide0: ports already in use, skipping probe
  ide1: I/O resource 0x170-0x177 not free.
  ide1: ports already in use, skipping probe

The second one here is the DVD device (at 0X170). Looking at the ATA information in dmesg:

ata2: SATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xBFA8 irq 15
ata2: dev 0 cfg 49:0b00 82:0210 83:0000 84:0000 85:0000 86:0000 87:0000 88:0407
ata2: dev 0 ATAPI, max UDMA/33
ata2: dev 0 configured for UDMA/33
scsi1 : ata_piix
ata2(0): WARNING: ATAPI is disabled, device ignored.

We can see that ATA has claimed the device (at 0X170), even though the final message indicates ATAPI support is disabled.

To enable ATAPI, and since the module is loaded very early at boot time (since it needs to access the hard disk), you need to create a new initrd with the appropriate option to be loaded at boot time. I attempted kernel command line via grub setting libata.atapi_enabled=1 and also setting it in /etc/modprobe.d/ but neither took effect). Edit /etc/mkinitrd/modules to add the line:

  libata atapi_enabled=1

Then create the new initrd:

  $ cd /boot
  $ sudo mv initrd.img-2.6.16-1-686-smp initrd.img-2.6.16-1-686-smp-orig
  $ sudo mkinitrd -o initrd.img-2.6.16-1-686-smp
  $ sudo reboot

The CD/DVD was then recognised on the reboot:

  $ dmesg
  ...
  ata2: SATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xBFA8 irq 15
  ata2: dev 0 cfg 49:0b00 82:0210 83:0000 84:0000 85:0000 86:0000 87:0000 88:0407
  ata2: dev 0 ATAPI, max UDMA/33
  ata2: dev 0 configured for UDMA/33
  scsi1 : ata_piix
    Vendor: PHILIPS   Model: DVD+-RW SDVD8820  Rev: AD15
    Type:   CD-ROM                             ANSI SCSI revision: 05
  ...

The alternative of adding libata.atapi_enabled=1 to the kernel boot parameters in Grub by adding the following in /boot/grub/menu.lst:

  \# kopt_2_6_16=root=/dev/sda5 ro libata.atapi_enabled=1

and then running the update-grub command, will report:

  Kernel command line: root=/dev/sda5 ro libata.atapi_enabled=1
  Unknown boot option `libata.atapi_enabled=1': ignoring

According to http://tkrat.org/d810/ support for CD-ROM devices on a SATA bus is still experimental in the kernel (at least 2.6.15) and they compiled their own kernel to turn on the support (and to support software suspend 2). Also see http://www.sirlab.de/linux/debian_dell_d610.html

Copyright © 1995-2006 [email protected]
Contribue and access the PDF Version