|[Home] [Credit Search] [Category Browser] [Staff Roll Call]||The LINUX.COM Article Archive|
|Originally Published: Wednesday, 24 January 2001||Author: Brian Richardson|
|Published to: enhance_articles_hardware/Hardware Articles||Page: 1/1 - [Std View]|
IDE CD-RW Installation Under Linux
Installing an IDE CD-R or CD-RW under Linux involves a few tricks. Brian Richardson's recent experience should help you avoid major problems.
Now IDE recordable CD-ROM drives are under $200, with the media costing pennies a piece instead of dollars. Low cost write-once (CD-R) and re-writable (CD-RW) CD-ROM make a great backup media. They're also handy for downloading ISO files of the latest Linux distributions.
But IDE CD-RW installation under Linux has one pitfall ... the kernel. Since Linux utilities treat all CD-RW drives as SCSI devices, some kernel modification is required to properly utilize IDE CD-RW drives.
I recently installed a HP 9030 IDE CD-RW drive in my work machine (Athlon 700, 128 MB, AMD Viper chipset). This new CD drive is replacing the "generic beige" CD-ROM drive. The HP 9030 is a 10X4X32 CD-RW drive (10X when writing CD-R, 4X when writing CD-RW, 32X when reading CD-ROM media). The CD-RW is setup as the secondary master IDE drive, with my 10GB hard drive as primary master.
To simplify this article, I will make the following assumptions:
Step One: Re-Configure The Kernel
Note: This article does not cover the exact method for re-compiling the kernel ... that information can be found in the HOW-TO and various other documents. This will cover the options required for CD-RW support when the kernel is configured.
The major issue with ATAPI/IDE CD-RW drives is Linux treats them as SCSI devices. This requires a change to the kernel which emulates all ATAPI/IDE CD-ROM devices as SCSI drives. >From the kernel configuration menu (make xconfig, make menuconfig, etc.), the following changes need to be made:
Step Two: Make The Symbolic Link
Reboot you machine using the newly compiled kernel. If all goes well, Linux will boot properly from the new kernel. Now it's time to see if SCSI emulation is properly enabled. This information is displayed at startup, but it goes by too fast for the average person to read. The dmesg command displays the system startup messages.
Login as root and type dmesg | more to scroll through the startup messages. If SCSI emulation is working, the following messages will be displayed:
scsi0 : SCSI host adapter emulation for IDE ATAPI devices scsi : 1 host. Vendor: HP Model: CD-Writer+ 9300 Rev: 1.0b Type: CD-ROM ANSI SCSI revision: 02 Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
Note the SCSI device that the new CD-RW was mapped to ... on my Mandrake 7.2 installation, this is /dev/scd0. The current CD-ROM link (/dev/cdrom) must be changed to point to the SCSI device instead of an IDE device (remember ... IDE CD-ROM support doesn't exist any more).
Change to the /dev directory. Remap the SCSI-emulated CD-RW to /dev/cdrom using the following command:
ln -sf /dev/scd0 /dev/cdrom
Step Three: Mount The Drive
Now Linux recognizes that /dev/cdrom is the SCSI-emulated CD-RW. But the drive has to be mounted to read data from the drive. As a test, do the following:
If the CD-ROM was properly mounted, its contents will show up in the /cdtest directory. Unmount the CD-RW by typing umount /cdtest.
Now edit the file /etc/fstab, which is a list of the mountable media available to the system. Look for the entry that mentions 'cdrom' ... on my configuration, this line appeared as follows:
/dev/hdc /mnt/cdrom iso9660 ro,noauto,user,exec 0 0
Change the device reference (/dev/hdc) to point to the SCSI device (/dev/scd0). Now the line appears as follows:
/dev/scd0 /mnt/cdrom iso9660 ro,noauto,user,exec 0 0
Save the changes to /etc/fstab. Now the CD-RW drive can be mounted using the command mount /dev/scd0 or mount /dev/cdrom.
Step Four: Configure CD Burning Software
Now that Linux can see your spiffy new CD-RW drive, it's time to make sure the CD burning software can see it. The defacto CD burning program for Linux is cdrecord. The cdrecord program will search for CD-R and CD-RW devices using the following command line: cdrecord -scanbus. This will report the information required for cdrecord and other burning software.
Once cdrecord verifies that the drive exists, it's party time. Download updated copies of cdrecord and mkisofs, which are the two essential Linux CD burning programs (I won't go over their use here, but there's lots of documentation). There are also a number of GUI front-ends and audio utilities to make life easier. So pick up a giant pack of shiny CD-R's and go to town.
How To Install CD Drives
cdrecord information at freshmeat.net
mkisofs information at freshmeat.net
CD-Rchive (mkisofs/cdrecord GUI)
X-CD-Roast (mkisofs/cdrecord GUI)
Andy McFadden's CD-Recordable FAQ
CD Writing HOWTO
You r CD Burner & X-CD-Roast (linuxnewbie.org)
CD Writing Tutorial (for linux)