justlinux.com
Sun, 27-May-2012 11:39:28 GMT

Forum: Registered Users: 76222, Online: 301
nhfs Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home Home

Help File Library: Easy Addition of an IDE CD-Writer to a Linux/Redhat PC

The CD-Writing HOWTO at http://www.guug.de/~winni/linux/ and the official cdrecord site at www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.htmlwww.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html offer a great deal of information about installing and using CD-ROM writers. Certainly much more than you need to know for an ordinary Linux installation. If you don't want to support an obsolete drive, or an older kernel, or VAX VMS, then you probably don't need to recompile the kernel or make any devices. This short document should be sufficient to get you started burning disks. Once you are started, the official documents will guide you to such esoterica as bootable, multisession and hybrid disks.

After determining that RedHat 6.1 was so easy, I tried setting up several other distributions, including RedHat 6.0, SUSE 6.1, Debian 2.1, and Storm 2000. All of those were slightly harder because they didn't include a recent cdrecord RPM file but none required a kernel rebuild, I have noted the differences along the way. You will need to have:

  • a supported IDE drive,

  • a Linux kernel that supports loadable device drivers,

  • use LILO to boot. (Default for most distributions).

  • cdrecord 1.8.1 or better (included with RedHat).

I believe any drives you bought in a store recently will qualify. The cdrecord docs say that all 1999 or later ATAPI drives support MMC, which is sufficient. Many earlier drives are suppoted also. A look on the shelves at the local computer superstore new drives at the store did not turn up any that mentioned MMC or Linux on the box. My first installation used an older Richoh MP6200A cd recorder. I did more installations with a MagicWriter 4X4X24. This is a very cheap drive, but the manual had a 1999 copyright date and it did work.

Physical Installation

Perform the physical installation of the new drive just as you would any ide drive. It can replace your original read-only drive or be added on. Make sure the drive jumper is set for master or slave as required, the power cable is connected and the data cable has the correct orientation. You shouldn't have to do any CMOS setup. I am told that keeping the cd-writer on a different cable from the hard drive speeds data transfers, but this is probably not significant with Pentium class machines.

At this point stop to check if the BIOS mentions the drive during BIOS initialization. Not all BIOS do that, but if it doesn't, you might want to check the cables and the Master/slave jumpers on both the CD-writer and any other drive on the same cable. The /var/messages file should have a line about the new "ATAPI" drive.

SCSI Emulation Setup

  1. Find out the name of physical CD-ROM device. This is probably /dev/hdc (the master device on the second IDE cable) but could be /dev/hdb (slave device on the primary IDE cable or /dev/hdd (slave device on the secondary
    cable).

  2. Become root.

  3. Add the following line to the end of your /etc/rc.local:

    insmod ide-scsi

    RedHat seemed to be the only distribution with an rc.local file. for the others, you have to find some other mechanism for running this command before attempting to record.

  4. Add the following line to the end of your /etc/lilo.conf file:

    append="hdc=ide-scsi"

    where "hdc" might be "hdb" or "hdd" depending on where your drive is installed. This instructs the kernel to access the cd-writer via the scsi emulation driver.

  5. Reconfigure LILO by running the following command at the Unix shell prompt:

    lilo

  6. You need to ``install'' cdrecord and mkisofs. Version 1.8.1 of cdrecord is on the RedHat disk in an rpm file. Here are the commands for the software installation with RedHat.

    cd /CD-ROM/RedHat/RPMS rpm --install cdrecord* rpm --install mkisofs*

    The other distributions either included an older version of cdrecord
    (1.6) which did not support my drives, or did not include cdrecord at all. If don't have RedHat and need to compile these yourself, the most recent version of cdrecord can easily be found at www.freshmeat.net. I noted that the very extensive cdrecord instructions cover many operating systems, not just Linux (or even Unix). For the distributions considered here, all you need to do is:

    tar -xvf cdrecord*tar cd cdrecord... make make install

    The cdrecord tarball includes mkisofs. Both packages get installed to /opt/shilly/bin so you will need to make links from a directory in the root path, such as /usr/bin.

  7. If you want to read with the recorder, you will need to add or modify the appropriate line in /etc/fstab so that the drive is addressed through the ide-scsi interface. The following worked for me, but the device name may not be correct for all distributions, and in any case reading is beyond the scope of this document.

    /dev/scd0 /cdrom auto defaults,ro,noauto,user,exec 0 0

  8. Reboot the machine. The installation is complete. My impression is that if you did anything wrong, there won't be any error messages, so go back and check the spelling of the changes listed above before proceeding to actually testing your work.

  9. Now you get to check if the installation was successfull:

    cdrecord -scanbus

    One of the output lines should mention a Removable CD-ROM, and maybe even indicate ``-R'' or ``RW'' to indicate that it is a recorder. Something like this:

    0,0,0 0) 'Richoh' 'MP602A' '2.03' Removeable CD-ROM Drive

    Only the digit triple at the start is significant. The only error message I saw in my experiments combined the cases of (1) scsi emulation not correctly installed and (2) drive not supported. At that point you might try getting reading to work as an IDE drive, then with SCSI emulation, before concluding that the drive was not supported.

Writing Disks

  1. Writing disks is a two step process. First the ISO filesystem is created on your hard disk:

    mkisofs -v -o file.iso file...

    where file.iso is your output file and file... is the list of files and directories you want on the cd-rom. If you just list a single directory, the structure is maintained on the CD. Otherwise all the files and subdirectory files are dropped into the root directory with no subdirectory structure. There are a lot of options described in the man page. If you keep your filenames to 8.3 lower case, you won't need to be bothered with most of them. The "-r" option (for Rock Ridge) will allow longer names, but if you actaully use longer or case sensitive names your file names will look funny or not work in a minimal ISO9660 system.

  2. Then you actually burn the cd-rom:

    cdrecord -v dev=0,0,0 file.iso

    The ``dev=0,0,0'' specifies the output device, and might be possibly be different on your system, check the cdrecord -scanbus output if in doubt. Because cdrecord wants to lock pages in memory, it has to be run as root.

    On my 1997 vintage 233mHz AMD with a 5400 rpm hard disk, and a double speed CD-ROM writer, the system had no trouble maintaining speed and the 512K buffer was never less than 97% full. After initial success you might try combining the mkisofs and cdrecord steps:

    mkisofs file... | cdrecord -v dev=0,0,0 -

    where the hyphen indicates to cdrecord that it should take its input from the standard input.

    Any corrections or suggestions should be sent to me. I am particularly interested in hearing which distributions will work with these minimal instructions.This page is kept at http://www.nber.org/cdrecord.html


    feenberg@nber.org