All graphics by The Gimp
Home Slackware Packages Site News IDE SCSI Howto IP Masq/NAT
Info & Apps
IPv6 @ aRDyNet Linux Links aRDy Music Eggdrop Scripts Whoami

IDE-SCSI CDR HOWTO

IDE-SCSI CDR HOWTO

Written by Rick Dicaire 01/31/99.

Last updated on December 22, 2007, 01:57:31 PM


CAVEAT: This document is no longer maintained, as the 2.6 kernel deprecates the need for configuration options discussed below. I leave the page up in case there are still users of older kernels that wish to utilize whats here.
This document was written using Linux kernels 2.1.x, 2.2.x, and 2.4.x. I use modules and if you don't, this should still work with kernel options compiled monolithically (is that a real word? *shrug* too lazy to look it up). The CDR I use for this doc is an HP 7200i, I also have an ACER 32X. These are IDE ATAPI devices. The CDR requires scsi emulation in order to utilize its writing abilities. This document does NOT tell you how to use mkisofs, cdrecord, or xcdroast. Refer to the appropriate software's documentation for information on them, and their usage.

This document also assumes a straight IDE PC, with no scsi controller cards (after all, if you had a scsi card, why would you bother with an IDE cd writer :-)

The following people are credited, I gleaned most of this from their various READMEs and other docs, and simplified it for the masses of new Linux users.

Credits:
From xcdroast docs - Thomas Niederreiter, and all those people HE credited for in his README.ATAPI. The authors of mkisofs, and cdrecord. The authors of the Linux kernel, "Use the Source Luke!" :) If I missed anyone, email me and let me know, I will fix it pronto!


Kernel Modifications

A note on modularizing CD support:
Since I initially wrote this, I've personally changed my module setup for both IDE and IDE-SCSI CDROM support. These changes are on a 2.4.x kernel. I modularized IDE CD support, SCSI support, SCSI CDROM, and SCSI generic. This gives me a choice of the CDROM support I want to use depending on the application that accesses the device. The ide-cd module autoloads when I mount the drives using their /dev/hdx device names. The ide-scsi module autoloads when I mount the drives using their /dev/scdx (or /dev/sgx, /dev/srx) device names. The only thing you really need to pay attention to when using a configuration like this is that you don't have modules for IDE AND SCSI loaded simultaneously. The drive won't work correctly if such is the case. lsmod will show you which (if any) is currently loaded. I also added a line to /etc/modules.conf to autoload ide-scsi support:

alias scsi_hostadapter ide-scsi

Don't forget to run depmod -a after altering modules.conf

Here are my /etc/fstab entries for the CDROM drives:

/dev/hdc        /mnt/cdrom iso9660       noauto,ro    0  0
/dev/hdd        /mnt/cdrom iso9660       noauto,ro    0  0
/dev/scd0       /mnt/cdrom iso9660       noauto,ro    0  0
/dev/scd1       /mnt/cdrom iso9660       noauto,ro    0  0
The mount points are arbitrary, I use a single mount point for all of them because I don't have a need to mount two CDs simultaneously. You may of course mount them wherever you wish.

[Kernel 2.2.x] [Kernel 2.4.x]
If you've never compiled a kernel before, see the Kernel-HOWTO and/or /usr/src/linux/README on your local Linux system.


Kernel 2.2.x

Under BLOCK DEVICES go with your usual defaults, NOTE the following:

Disable CDROM support, enable SCSI emulation support.

Under SCSI Support:

Enable SCSI support, SCSI CDROM support, Enable vendor-specific extensions, and SCSI generic support. You can modularize these as I have, or add them in full (select y instead of m). Further down in the above menu is SCSI low-level drivers --->. Go in here and disable any and all SCSI controller card support (default unconfigured kernel has one of the SCSI cards enabled, select n for it). Make sure no other cards are enabled. Exit the kernel configuration, saving the options. Compile and install kernel. Reboot. Watch boot messages for something like the following:

hdc: HP CD-Writer+ 7200, ATAPI CDROM drive
hdd: ACER CD-787E/JAS, ATAPI CDROM drive

scsi0 : SCSI host adapter emulation for IDE ATAPI devices
scsi : 1 host.
  Vendor: HP        Model: CD-Writer+ 7200   Rev: 3.01
  Type:   CD-ROM                             ANSI SCSI revision: 02
  Vendor: ACER      Model: CD-787E/JAS       Rev: 22N 
  Type:   CD-ROM                             ANSI SCSI revision: 02
scsi : detected total.

The above shows my CDR and ACER IDE/ATAPI detected. If you missed the boot messages type the following at the prompt:
dmesg | less

If you're successful, cdrecord -scanbus should return something similar to:

Cdrecord 1.8a40 (i586-pc-linux-gnu) Copyright (C) 1995-2000 Jörg Schilling
Using libscg version 'schily-0.1'
scsibus0:
        0,0,0     0) 'HP      ' 'CD-Writer+ 7200 ' '3.01' Removable CD-ROM
        0,1,0     1) *
        0,2,0     2) *
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *

On my system the following modules are autoloaded when an audio CD is played:

sr_mod                 17068   2  (autoclean)
cdrom                  11584   0  (autoclean) [sr_mod]

When I mount a data CD, additional file system support module(s) are loaded:


isofs                  17096   1  (autoclean)

The scsi generic module sg.o gets loaded when you burn a cd:

sg                     12012   0  (autoclean)

Scroll through and look for similar to above. If you don't see the above, here are a couple things to check for:
Make SURE you disabled IDE CDROM support in the kernel configuration. If its still enabled, it will be the first support loaded for CDROM devices, and SCSI emulation won't work. If you chose to modularize, ensure kernel module autoload support is enabled and that the modules are loaded. Module autoload differs from kernel 2.0.x and 2.1.x/2.2.x. See /usr/src/linux/Documentation/modules.txt for more info on module loading.


Kernel 2.4.x

Under ATA/IDE/MFM/RLL support go with your usual defaults, NOTE the following:

Disable CDROM support, enable SCSI emulation support.

Under SCSI Support:

Enable SCSI support, SCSI CDROM support, Enable vendor-specific extensions, and SCSI generic support. You can modularize these as I have, or add them in full (select y instead of m). Further down in the above menu is SCSI low-level drivers --->. Go in here and disable any and all SCSI controller card support (default unconfigured kernel has one of the SCSI cards enabled, select n for it). Make sure no other cards are enabled. Exit the kernel configuration, saving the options. Compile and install kernel. Reboot.


CDROM usage

Here's where things may differ and I can only show my own setup as an example, your mileage may vary. My CDROM devices are on the secondary IDE interface, the CDR is /dev/scd0 and the ACER is /dev/scd1. I use the ACER for audio CD playback and have the /dev/cdrom link set to /dev/scd1. workman, workbone, and maybe others, look for /dev/cdrom to play.

ls -l /dev/cdrom lrwxrwxrwx 1 root root 9 Jan 1 16:55 /dev/cdrom -> /dev/scd1

The CDR is /dev/scd0. I can also use both to mount data CDs. Here's my /etc/fstab entries for them:

/dev/scd0       /cdrom    iso9660      noauto,ro 0 0
/dev/scd1       /cdrom2   iso9660      noauto,ro 0 0

This configuration is arbitrary. See here for other /etc/fstab entries. However, since only one /dev/cdrom link can be set, its recommended by this author that you link it to the device best suited for your CD audio playback needs.

I hope this has been helpful. This author can be found on IRC (EFNet) in #linuxhelp.