IDE CD-ReWriter Setup Under Linux

Introduction

Recently, I added a Ricoh 7083a IDE CD-ReWriters to two Linux machines: one running SuSE 6.2 (2.2.17) and one running Debian 2.2r3 (2.2.19). This page gives a few notes that i found useful when doing the job. I did not make these notes exactly as i was doing the job, so they are not perfect, but there were a couple of points i came across that might be of use to you. What i would say, is that installing a CDRW drive is NOT difficult, but it looks offputting (to me) when you read about it (what with simulating SCSI and the like!). If you are thinking about doing it, but a bit nervous, try setting up your existing cdrom drive as a SCSI device (see below) to see how easy it is in practice.

Instructions

There are very many good resources both for CD-ReWriting in general, and also for CDRW under Linux in particular:
  1. CD-Writing HOWTO by Winfried Trümper (you probably got this with your Linux distro) is the most important source of information for the basic process of installing and using your CDRW drive using Linux.
  2. Compatibility list of CD-Writers. This is a pretty complete list (i.e. I could find all the drives I considered buying here), although you are relying on info from other users (like this info in front of you ;-). List is not alphabetical, search for your make and model.
  3. CD Record by Jörg Schilling is probably the software you will want to use to do your burning. Even if you plan to use a graphical tool, cdrecord will be under the hood doing the hard work! This page also has lots of good links
  4. CD-Recordable FAQ by Andy McFadden is full of useful info about CD-Writing (not specific to Linux). Has info on what CD-Writers are equivalent (same innards, different badge).

Notes:

You will probably need to recompile your kernel. This is not very difficult, but can be dangerous, the Kernel HOWTO has extensive instructions. Make sure you have a working boot-disk before you start, as that should get you back from most catastrophes ;-). First install, the sources of you distro's kernel (or one from the net). Source is usually in /usr/src/linux. cd into the directory, and run
make menuconfig
From [1] above, you will need the following

Sect.DescriptionModuleChoice
BLOCKEnhanced IDE/MFM/RLL...Y
BLOCKIDE/ATAPI CDROMide-cdM
BLOCKSCSI emulation supportide-scsiM
BLOCKLoopback deviceloopM
SCSISCSI supportscsi_modY/M
SCSISCSI CD-ROM supportsr_modY/M
SCSIEnable Vendor SpecificY
SCSISCSI generic supportsgY/M
FSISO 9660 CDROM filesystemiso9660Y/M
FSMicrosoft Joliet cdrom...jolietY/M
This configuration is most easily done using the command "make menuconfig". If you have a vendor supplied kernel, it might have the correct options already compiled in. Try making the changes to your modules.conf, lilo.conf, run depmod, run lilo, and then reboot. Try "cdrecord -scanbus" and see how far it gets you. I would recommend that you select the module option for the SCSI options. I ran into some problems when i compiled them directly into the kernel as the later instructions describe configuration through modules.conf which did not work. Keep it simple, and use modules.

The basic kernel compile commands are

make dep; make clean; make bzImage
To compile the modules, type
make modules; make modules_install
copy the System.map file created in the /usr/src/linux directory to the /boot directory (say, under the name System.map-2.2.19, if you are using 2.2.19 kernel, as this lets you maintain a few system maps around). The new kernel will be in /usr/src/linux/arch/i386/boot/bzImage. Copy it to /boot/bzImage-cdrw01 or some similar filename. Edit lilo.conf (see below) and add an entry pointing to the new kernel. RUN LILO!

Again, from [1], you will need to configure modules.conf to include the lines:


options ide-cd ignore=hdb # tell the ide-cd module to ignore hdb
alias scd0 sr_mod # load sr_mod upon access of scd0
pre-install sg modprobe ide-scsi # before sg, load ide-scsi
pre-install sr_mod modprobe ide-scsi # before sr_mod, load ide-scsi

This works fine if you selected the SCSI features as modules. AGAIN! from [1], you will probably need to reconfigure lilo along the lines of:

image=/boot/zImage-2.2.14
label=Linux
read-only
append="hdb=ide-scsi"

The last line being the important one (i.e. you will already have lines like the previous 3). hdb is the device the cdrw appears as (if you boot your system normally, you should be able to access your cdrw as a normal cd-rom drive by typing, for example, "mount /dev/hdb /cdrom". As an aside, when installing the drive on my Debian machine, the SCSI-cd module actually took control of both my CD-ROM and my CD-RW. This is not bad, but might break some of your configurations. I got around this by using the line:
append="hdb=ide-scsi hdc=ide-cd"
in my lilo.conf. I think this problem occurs depending on the order the modules are loaded (the first one will grab both cd-rom and cd-rewriter unless you stake out their territory for them).

Following on from the last point, it is perfectly possible to use your IDE cd-rom drive as a scsi device. Compile the kernel as advised, and do all the steps as described for configuring a CDRW drive (but using the /dev/hd* name of the cd-rom drive). Running the command cdrecord -scanbus should indicate that you have one scsi device. This drive can then be mounted using something like "mount /dev/scd0 /cdrom". Once you have accomplished this, it is really no more difficult to install a CD-RW (apart from having to actually plug it in!).


Wed Jul 4 12:35:19 IST 2001
A final note which may help anyone who uses their cdrom drive in scsi emulation mode. If you want to use cdparanioa with the cd-drive, you need to have permissions on /dev/sg0 (assuming it is the first scsi device on the bus). This caught me out, as i could mount the cd-drive, and indeed rip using cdda2wav with only permissions on /dev/scd0. one way to do this is as root:
chown root:cdrom /dev/scd0
chown root:cdrom /dev/sg0
adduser your_login_name cdrom
(you could edit /etc/group instead of the last line, if you like). mc
Copyright © 2004 Michael Conry Disclaimer Wed Sep 14 19:36:32 2005