A lot has changed since this document was written. I found a better method of reading CD devices, and the 2.6 kernel has changed the dev= argument to the cdrecord command. I suggest you read the Coasterless CD Burning document along with this one.
So I'd recommend you try to get your CDRW running on a normal IDE
before attempting it on a high performance port.
Decide whether this drive will be a master or a slave. In deciding where to put this drive, please remember that simultaneously running two drives on the same IDE cable severely degrades the performance of both. If you don't do a lot of CD to CD duping, you might want to put your CDRW on the same IDE cable as your readonly CD drive.
Once you've set the jumpers for master or slave (I use master if it's the only one on the cable), with the power supply switch set to 0, or if there's no power supply switch with the computer unplugged, slide the CDRW drive into the bay, connect both power and IDE cable. Be sure to get polarities right. Take care not to bend any IDE connector pins. Be sure to remember which IDE port you've connected it to, and whether it was a master or a slave. Note that you might need to rejumper the master/slave status of the device that was already on the cable.
Once all connections are made and checked, place the unit right-side-up, plug it into wall current, switch the power supply switch to the 1 position, and power up the computer.
For the rest of this document, all examples will be /dev/hdc (master of 2nd IDE port). Modify these examples to fit your machine.
Unless the device itself works, no CDRW functions will work. So start by confirming that the device works. With no CD in the CDRW tray, and no mount of the CDRW, and the CDRW tray in the closed position, perform the following command:
eject /dev/hdcIf the CDRW tray opens, the device works. Otherwise it doesn't. Troubleshooting includes making sure you really used the master/slave jumper setting you thought you did, and making sure power and IDE cable are correctly connected. You might try the command with /dev/hda through /dev/hdh just to make sure the CDRW isn't connected differently from what you thought.
By far the easiest way to test your hardware is to boot to a Knoppix CD. If your CDRW is installed correctly, Knoppix should detect it and enable you to burn CD's. Once the CDRW is working in Knoppix, you know your hardware is working right. Additionally, you can learn a lot by looking at the various config files from within Knoppix.
Once you have your CDRW drive ejecting, it's time to configure its SCSI simulation...
Most modern Linux distributions work "right out of the box" when installed on a machine with a correctly wired up CDRW drive. If you plan on doing a reinstall in the near future, consider putting in the CDRW beforehand, and then installing. This can save considerable trouble.
Another tip is to boot Knoppix, verify that you can burn CD's from within Knoppix, and study the Knoppix CDRW configuration.
alias scsi_hostadapter ide-scsiNote that depending on your distribution, the line might be required to look like this instead:
alias scsi_cd ide-scsiI've never seen it necessary, but there are those that say the following is sometimes also a necessary addition to /dev/hdc:
options ide-scsi ignore=hdcDon't include the preceding line unless you can't get your CDRW to work without it.
Before modifying /etc/lilo.conf, make sure you have a boot diskette that will boot your system. Test it. If you don't, make one with the mkbootdisk program!
Accidents happen, and if you mess up /etc/lilo.conf without a boot disk, you will encounter extreme difficulties getting your system to boot.
Start by backing up your original /etc/lilo.conf. Note that lilo.conf has several images, each of which can be booted. In each boot image you wish to recognize the CDRW, check lilo.conf to see if it has an append= line. It might look something like this:
append=" devfs=mount quiet"Because each image can have only one append= statement, you must append hdc=ide-scsi to the existing statement, like this:
append=" devfs=mount quiet hdc=ide-scsi"In the preceding, please remember to substitute hda, hdb, hdd, etc. for hdc as appropriate for the CDRW's device.
If a boot image does not have an existing append statement, add the
following line to the boot image.
add the following line to /etc/modules.conf:
append="hdc=ide-scsi"After you've saved your modifications, run lilo. It should look something like this:
[root@mydesk /etc]# lilo
If there are error messages, DO NOT reboot until you've fixed them. Once there are no error messages, reboot the system. If it doesn't boot, boot it with the bootable floppy you made earlier, back up your lilo.conf, and then copy the original lilo.conf on top of the one you modified. Then run lilo again. You should once again be able to boot without the floppy.
On some Linux distributions, /usr/bin/cdrecord is not executable by all, and so only works for root. To use it as a normal user you must chmod it to be executable by all, or else executable by group, chgrp it to a different group, and then place all users required to use it in that group.
I don't know whether the original mode of cdrecord was an oversight, or whether it was done for security.
Try the following command:
cdrecord -scanbusIf you're lucky, it will give you a SCSI device number for the CDRW, as in the following example:
[root@litttest root]# cdrecord -scanbus
Typically you won't get lucky right after the install. Your results
might look more like the disappointing results below:
[root@litttest root]# cdrecord -scanbus
Results like the preceding are typically caused by ide-scsi,
or similar modules not being loaded or not being loaded correctly. Run
the rmmod command several times until told it's not loaded:
[root@litttest root]# rmmod ide-scsi
Now load the ide-scsi module as follows:
[root@litttest root]# insmod ide-scsi
Then run cdrecord -scanbus again. If it presents you with a SCSI device number, continue to the next section. Otherwise, review all the configuration steps and try variations on /etc/modules.conf. Be sure after changing /etc/lilo.conf you really ran lilo, and ran it successfully.
Once you know the SCSI device number, the maximum speed and the filename of the ISO image, you can burn the CD. Assuming the info in the preceding paragraph, with the SCSI device number being 0,0,0, and a 16x write-once blank CD, the following command should burn the CD:
cdrecord dev=0,0,0 speed=16 -pad -v -eject Mandrake81-cd1-inst.i586.iso
Notice the -pad option in the preceding command. Without it, this CD will not read correctly on some computers. This is due to the well documented "ISO-9660 filesystem read ahead bug". You can read about this bug on the cdrecord man page, in the padsize= section.
KERNEL 2.6 WARNING
The 2.6 Linux kernel substantially changes the way CDRW drives are accessed, and you might find that your cdrecord command no longer works. Specifically, with the 2.6 (and probably later) kernel, you might need to prefix your device with the string ATA: like this:
cdrecord dev=ATA:0,0,0 speed=16 -pad -v -eject Mandrake81-cd1-inst.i586.iso
If the CD burns and ejects, you're not done. You must compare its contents to the original file.
mkisofs -pad -o backup.iso backup.tgzYou can test the ISO image as follows:
[root@mydesk slitt]# mkdir /mnt/test
In the preceding steps, notice that the diff command gave no output, indicating that the copy of backup.tgz inside the ISO file is identical to the original.
Be aware that mkisofs has *many* options. Some crucial ones are rockridge and joliet extensions, which enable long filenames. Joliet extensions make the CD a Windows like CD. There are extensions for Macintosh compatibility. And there are many, many more.
Also be aware that often the easiest way to master an ISO is with a higher level program such as
See also: [ Linux Library | Troubleshooters.Com | Email Steve Litt | Copyright Notice ]
(C)2001-2002, 2004 by Steve Litt. -- Legal