CDWriter Page

One of the final steps to a person finally breaking totally away from Windows seems to be the ability to backup their data and to be blunt.... burn CD's. UNIX derivatives have been able to burn with SCSI recorders for a long time, but if your like me, you never could (or would) afford one. A good percentage of us already have one and with prices falling under $100 US, the majority of us will likely have them within a year or two. The majority of the burners we will own will be of the IDE/ATAPI style, though supported (somewhat) in *NIX for roughly ten years has finally gotten to the point that many of us could get them to work properly. Linux in particular has failed to make the suggested kernel code changes to make this easier, while other flavors like Solaris have had an advantage for several years. What it boils down to is though Linux isn't the best native support for IDE/ATAPI burners, it isn't hard to get them to work. There is simply a failure to have a howto in layman's terms to follow in order to get them setup. This is the driving force behind this "not-to-technical" howto for IDE CD-R/RW's.

This howto borrows heavily from the CD-writing HowTo posted on roughly a million different web sites. I am simply re-explaining and simplifying the IDE part..... the credit for any technical aspects should be acknowledged properly. What is confusing is that for *NIX to write to any CD burner, it must be used as a SCSI device.... whether it is or not! It is a misperception through explanation in the "proper" howto that all cdrom devices will have to be set as scsi devices for the burner to work. This is absolutely not true!!! The truth of it is that you *must* setup the burner as a scsi device and tell the system that your normal cdrom and DVD player's are *not* scsi devices. Make sense?


**** SETUP THE SYSTEM ****

Anyway,the first step is to load the necessary modules for running the burner as a scsi device. You can do this at a command prompt, but we'll stick them where they belong in the boot files. The first file will be either /etc/rc.d/rc.modules or /etc/modules.conf, depending on your Linux distribution. The modules may already be listed in the file, just commented out with an "#". If so, just un-comment them, otherwise copy these lines into the file:

options ide-cd ignore=hdc # tell the ide-cd module to ignore hdc
alias scd0 sr_mod # load sr_mod upon access of scd0
#pre-install ide-scsi modprobe imm # uncomment for some ZIP drives only
pre-install sg modprobe ide-scsi # load ide-scsi before sg
pre-install sr_mod modprobe ide-scsi # load ide-scsi before sr_mod
pre-install ide-scsi modprobe ide-cd # load ide-cd before ide-scsi

You will also want to add this line to /etc/modules.conf on all distro's:

options ide-cd ignore='hdd'

You will also need to make sure that the modules "loop", "iso9660", and "joilet" are either compiled in the kernel or loaded as modules. Almost every distribution compiles these in the kernel stock anymore. If you later have problems, try loading these as a troubleshooting path.

For system reasons, "modprobe" almost always works when the "insmod" command fails, so I use it! The second step is to tell LILO which cdrom device to use as ide and which to use as scsi. If you use LILO as your bootloader, open /etc/lilo.conf and add the missing line to it (edited for your particular device). My regular cdrom is hdc and my burner is hdd. As follows:

image=/boot/zImage-2.2.14
label=Linux
read-only
append="hdd=ide-scsi"
#Listing: Example configuration for lilo (/etc/lilo.conf)

Next up, you need to make a mountpoint for the burner. Most distro's now use either "/cdrom" or "/mnt/cdrom" for your regular cdrom device. For the sake of simplicity, stay with your distro's convention and create a new directory "/cdrw" or "/mnt/cdrw" appropiate to your distro's setup. Don't forget to give permissions to whatever users you want to access this device. If this is the only scsi device on your system, it will be known as "/dev/scd0". To check a cd in the device from now on, enter "mount /dev/scd0 /cdrw" or "mount /dev/scd0 /mnt/cdrw". Another way of automating this would be to enter the following line in "/etc/fstab":

/dev/scd0 /cdrw iso9660 noauto 0 0
or
/dev/scd0 /mnt/cdrw iso9660 noauto 0 0

Let's reboot the computer now so all the changes we have made can take effect.

USING THE BURNER

Well, let's see if we can find the burner now that everything is loaded.
At a command prompt, enter:

cdrecord -scanbus

If your device is found, you should get an output like:

shell> SCSI_BUS=0 # taken from listing 1 "scsibus0:"
shell> SCSI_ID=0 # taken from listing 1 "TOSHIBA XM-3401"
shell> SCSI_LUN=0

or simplified like "{blah, blah} SCSI 0,6,0 {blah, blah}"

If the output did not come up with any information like this, either the proper modules are not being loaded properly or your burner is not supported. If this is the case, check with http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html for more detailed information.

Otherwise, we can now attempt to burn your first iso!
Put a new CD-R in your burner and let's give it a whirl.
Take the output of your command to burn a data .iso image with a command like:
(*REMEMBER* Modify this command for your burner information.)

shell> cd {path-to-iso-directory}
shell> cdrecord -v speed=2 dev=0,0,0 -data /path-to-file/cd_image.iso

You should see the program startup, layout the iso, and then burn it.
You will get a command prompt when it is done, or errors out.
Don't do any heavy cpu use during the burning, because if there is **any** hesitation in the data flow during the burning process, the process will hang and you'll end up with a frisbee or drink coaster!

FINAL THOUGHTS

Some command line and graphical interfaces that exist for Cd buring are:

Command line utilities

One of the following packages are required to generate images of CD-Rs (only required for data CD-ROMs):

ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/ (mkisofs)
ftp://ftp.ge.ucl.ac.uk/pub/mkhfs (mkhybrid)

To write images to the CD-R, you need one of the following software packages:

ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (cdrecord)
http://www.ping.de/sites/daneb/cdrdao.html (cdrdao)
http://www.munich-vision.de/vcd/ (mkvcdfs)
Don't trust the man page of old versions of mkisofs which state you need version 1.5 of cdwrite. Just use cdrecord and you are fine. Please note that newer versions of cdrecord ship with an enhanced version of mkisofs and some extra tools in the subdirectory misc/ (readcd, isosize) not found elsewhere.

Graphical user interfaces (optional)

Front-ends are really front-ends under Linux. That means, you still have to install the command-line utilities, but you access them in a better looking manner.

X-CD-Roast is a program package dedicated to easy CD creation under Linux. It combines command line tools like cdrecord and mkisofs into a nice graphical user interface.

http://www.fh-muenchen.de/home/ze/rz/services/projects/xcdroast/e_overview.html

BurnIT is a JAVA front-end to cdrecord, mkisofs and cdda2wav-0.95 making it a complete package for burning CDs on the Unix platform. It is available from

http://sunsite.auc.dk/BurnIT/

CD-Tux is a character based frontend for the programs mkisofs and cdrecord. "It creates an easy to use enviroment for doing almost anything to a CD in full color through the use of the (in)famous NCURSES Library. And it does all this whith an executable of under 75K."

http://www.datadictator.co.za/cdtux/

***** MODULE TROUBLESHOOTING LIST *****

Sect. Description Module IDE

---------------------------------------------------

BLOCK Enhanced IDE/MFM/RLL... Y
BLOCK IDE/ATAPI CDROM ide-cd M
BLOCK SCSI emulation support ide-scsi M
BLOCK Loopback device loop M


SCSI SCSI support scsi_mod Y/M
SCSI SCSI CD-ROM support sr_mod Y/M
SCSI Enable vendor-specific Y
SCSI SCSI generic support sg Y/M

FS ISO 9660 CDROM filesystem iso9660 Y/M
FS Microsoft Joliet cdrom... joliet Y

Y stands for yes and means you should put the beast into the kernel. M stands for module and means you should or must compile this feature as a module. Y/M gives you the option to decide between either (order indicates choices with less potential problems). Empty settings don't need to be modified and not changing them increases the chance that the resulting kernel will work for you (if it did before...). Especially in environments where SCSI and ATAPI devices are mixed, you better build most things as modules.
Compiling loopback device is optional. It allows you to test the image before writing it to the media. If you want to be able to read CD-ROMs, you need support for the ISO 9660 filesystem. This driver automatically includes RockRidge Extensions. The Microsoft Joliet CD-ROM extensions have to be explicitly added to the ISO 9660 filesystem. In any case, you need a low-level driver for your hardware. Low-level refers to the driver, which interacts directly with the hardware. For SCSI and the parallel port, there are a lot of low-level drivers available.
Installing the resulting Linux-kernel is beyond the scope of this HOWTO. Please consult the documentation of your Linux-distribution.


I hope this helps,


~Guitarlynn



| copyright 2000 | Contact Guitarlynn |