GNU/Linux Desktop Survival Guide by Graham Williams |
|||||
CD Writer as a SCSI Device |
CD writing software for GNU/Linux (prior to kernel 2.6) targets SCSI devices, so you will need to install appropriate drivers so that your ATAPI IDE CD-RW (and your CD-R/DVD if you wish) pretends to be a SCSI device. It will then be identified as /dev/scd0 rather than /dev/hdd.
Turning a IDE CD-RW into a SCSI CD-RW is pretty straightforward. First ensure the appropriate kernel modules are loaded (you need sg and ide-scsi). Use the command lsmod to list the modules currently loaded in the kernel, and the commands modconf or insmod to load the modules. If you already have the drive under the control of ide-cd then you need to get rid of it (as below).
You can ensure these happen at boot time, and the appropriate
dependencies between kernel modules are identified, by creating
/etc/modutils/cdrw:
# # As suggested in CD Writing HOWTO # # This assumes IDE-CD is a module rather than copmiled into kernel. # options ide-cd ignore="hdc hdd" alias scd0 sr_mode pre-install sg modprobe ide-scsi pre-install sr_mod modprobe ide-scsi pre-install ide-scsi modprobe ide-cd |
Note here that we are telling the IDE CD module to ignore the disk
which we want the ide-scsi module to handle. The ide-scsi module won't
touch any disks already being driven. Change the hdd to the
appropriate one of hda, hdb, hdc, or hdd. To check which one to ignore
look through the output of the dmesg command for the CD-RW
line which identifies the driver, which on Alpine (104.27) is:
hdd: ATAPI 40X CD-ROM CD-R/RW drive, 2048kB Cache |
Thus ide-cd should ignore hdd. If you want all CD drives to be SCSI (useful for some cases like cdrdao when asked to copy a disk) then don't include either of the lines that mention ide-cd!
Now update the modules.conf file with:
# update-modules |
Finally, tell the kernel to load the modules at boot time by adding
the following to /etc/modules:
sr_mod sg ide-cd |
You will now probably need to reboot to have the new configuration take effect. Also, don't include ide-cd if you want all your drives recognised as SCSI.
Once set up cdrecord can be used to identify the SCSI device on which the CD writer sits:
For example, on Mint (104.34) the device is 0,1,0. The
LG CD-RW CED-8080B 1.04 on this host is identified using:
# cdrecord -scanbus scsibus0: 0,0,0 0) '_NEC ' 'DV-5700A ' '3.07' Removable CD-ROM 0,1,0 1) 'LG ' 'CD-RW CED-8080B ' '1.04' Removable CD-ROM |
# cdrecord -scanbus scsibus0: 0,0,0 0) 'QUANTUM' 'ATLAS10K2-TY184L' 'DA40' Disk scsibus2: 2,0,0 200) 'SONY' 'CD-RW CRX140E' '1.0n' Removable CD-ROM |
Alpine (104.27) and Velox (104.33) have DVD drives (which remain as IDE devices as /dev/hdc) and a CD-RW writer (which with the above set up becomes /dev/scd0). Mint (104.34) also has two drives but both are run as SCSI devices.
On more recent kernels you may need to prefix the device with ATA:
$ cdrecord -scanbus dev=ATA |
To list the capabilities of your CD/DVD drive:
$ cdrecord -prcap dev=ATA:1,0,0 |
If you are having problems with CD drives being found try adding ide-probe-modbefore ide-scsi in /etc/modules.
A line that someone suggested to be added to lilo.conf:
append = "apm=on apm=power-of idebus=N hdc=ide-scsi hdd=ide-scsi max_scsi_luns=1" |
I've not used this.
Specify the default device for cdrecord in the file
/etc/default/cdrecord:
CDR_DEV=/dev/cdrom |
Copyright © 1995-2006 [email protected]