Burning CDs in Linux: Tips and Tricks

By: Dee-Ann LeBlanc
Tuesday, July 30, 2002 11:39:36 AM EST
URL: http://www.linuxplanet.com/linuxplanet/tutorials/4342/1/

This Does Not Have to Be Difficult

It doesn't seem that it should be that hard to burn a CD or CD-ROM, especially in the case of Linux distributions where you're given the base image to start with and just have to put the process in motion. But it's not that simple. Between shoddy media, misaligned lasers, and all of the other subtle things that can go wrong it's amazing that we manage to get anything burned at all.

This article is not meant as an introduction to CD burning. Instead, it's a catch-up for those who are familiar with burning but haven't done so in Linux, or those who know just the basics and want to get past some of their common frustrations.

If you're not well versed in CD and CD-ROM burning terminology, then the rest of the discussion will get confusing pretty quickly. Let's take a look at the various terms used in the world of putting data on pretty metal disks, and some of the distinctions I make when talking about these issues for the sake of clarity:

  • A CD contains music, pictures, or movies (if it's a video CD)--though traditionally only a music CD is a "CD." It doesn't have any actual programs on it. Some CDs cross over these days by having special functions on them to enhance their use, so I usually refer to something by its primary function. To me, a music CD that has some funky games and interactive features is a CD.
  • A CD-ROM, to me, contains programs to run or data. If I back up all of my word processor files onto a disk, I make a CD-ROM. If I burn a Linux distribution onto a disk, I burn a CD-ROM--okay, technically if it's a rewriteable it's not a ROM. Most of what I'll be talking about in this article refers to CD-ROMs.
  • Burning is the actual process of writing information to a CD or CD-ROM.
  • An "image," or .iso, is the single file that's either downloaded or built, and is actually burned onto the CD-ROM.
  • A CD writer or burner is the drive you use to write information to a CD. Rather than saying CD and CD-ROM, I'll just refer to these drives as CD writers, but I'm referring to both in this context.
  • A WAV file is the format that music is placed into before being burned onto the CD. WAV files are significantly larger than MP3 files, so make sure you have plenty of space before either having an outside program convert them, or converting by hand.

Making Sure the Download's Right

Before you even get to the point of burning a CD-ROM, it's a good idea to check whether or not the complete file downloaded properly. This policy is especially a must when it comes to large files such as ISOs for a Linux distribution. In cases like this, many FTP and web sites offer what's called a file containing what's called an MD5 checksum.

A checksum is simply the number of bits that this file is supposed to contain, but just used by itself provides no extra assurance that a file hasn't been tampered with, since anyone could just change the value stored in the checksum file. Combining MD5 with the checksum issue does add a level of security. An MD5 checksum is a 128-bit set of characters that are produced using the file's original contents, and can be reproduced just as any fingerprint can be taken twice.

So between being worried that a file hasn't fully arrived, and wanting to be sure that the file you got, say, off a mirror or a third-party site hasn't been tampered with, you can get the original MD5 checksum value from the file's main provider. Your MD5 checksum checker will then calculate the checksum that should be assigned to the file you downloaded, and compare it to the file you grabbed that contains what the MD5 checksum should be.

If they don't match, then something's wrong.

You don't need a fancy tool to check an MD5 checksum. You don't need to download anything, either. The program md5sum comes with most mainstream Linux distributions, and if it's not installed by default it's probably on your distro's CD-ROMs somewhere. First download the file itself, and then edit the corresponding file containing the MD5 checksum, or copy and paste the MD5 checksum from the web site into a file. After the MD5 checksum in the file, put the name of the file you want to check, and the path if it's not in the same directory as the MD5 checksum file.

You then use this program in the format:

md5sum --check MD5checksumfilename

The md5sum program runs a MD5 checksum on the file specified with MD5checksumfilename, and then compares its answer to the MD5 checksum in the file.

For example, I might download nethack-3.4.0-1.i386.rpm. On the site where I download this, there's a list of MD5 checksums for all of the different versions of this file, including:

20cc27bee69ba82adbd60df04efb9a7a  ./binaries/linux/nethack-3.4.0-1.i386.rpm

The left portion is the MD5 checksum, and the right portion is where this file is on their particular site. However, when I download this file, I save it just in my home directory. So I make a text file in the same directory containing only the following:

20cc27bee69ba82adbd60df04efb9a7a  nethack-3.4.0-1.i386.rpm

After I save the text file as nethacksum, I type :

md5sum --check nethacksum

The result is just what I was hoping for:

nethack-3.4.0-1.i386.rpm: OK

The Burning Software

CD writers come with software, and for many people that default software is adequate. I'm not here to evangelize for a particular package, though as always I'm happy to recommend a few. There's the ubiquitous cdrecord
(http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html), which is included by default in just about all Linux distributions, and is often installed by default as well.

If you type man cdrecord and immediately get hives from the immense number of options for this command-line tool, don't worry. There are actually quite a number of GUI front ends that can make become familiar with this tool a lot more pleasant. For a full list of these, including screenshots, go to
http://sites.inka.de/~W1752/cdrecord/frontend.en.html ... here you'll find numerous solutions for QT/KDE, GTK/GNOME, TCL/TK, and even one for ncurses and one for Java. You might even find that one or more of these GUI solutions is already installed on your machine, or is included in your distribution media.

Many of the items listed on the page mentioned above are actually in alpha or beta. One that isn't and has a certain amount of popularity is cdrtoaster (http://www.jump.net/~brooke/cdrtoast/), which comes bundled with many distributions. If your specific interest is with music, then check out http://www.mp3-converter.com/linux/ for not only an attractive site, but also a great selection of freeware, shareware, and commercial tools for both data and multimedia.

For additional help there's also a CD-Writing HOWTO at the Linux Documentation Project site (www.tldp.org), but unfortunately it's from 2000.

Tips and Tricks

Not all CD-ROMs burn cooperatively. I've especially run into problems lately trying to burn a distribution beta onto CD-ROM, and there's a few interesting issues that came up while trying to solve the problem:

  • Large CD-ROM images can be fussier than we think. If you're consistently having trouble with disks burned at your burner's faster speed, drop the speed down quite low, say to only 4X.
  • If your CD burning software has a verification feature, this may not be enough to check a subtle problem with a burn! Some Linux distributions are starting to answer this need. For example, Red Hat Linux provides a function in its installation routine called "mediacheck," as of version 7.3.
  • If you're having consistent problems getting CD-ROMs burned and can't stand to deal with the slow speed fix, consider getting a CD-ROM drive that contains BURN-Proof (tm) technology. The BURN stands for Buffer UnderRuN, which is a term that refers to how we make nice shiny coasters when the buffer containing the next bit of data to burn to the CD-ROM is empty or the machine is too busy to send the data, and the CD writer just merrily goes along and writes junk to the media. BURN-Proof burners have a massive buffer and have the ability to stop and wait for more data. There are a number of products and sites that support and contain up to date information about what's happening in this product area, a quick Google search on "burnproof" is pretty educational.

The latest versions of cdrecord support BURN-Proof.

Dee-Ann LeBlanc has written over 10 computer books, over fifty articles, taught classes, and more, mostly involving the Linux operating system and its programs. Her latest book is Linux Routing from New Riders. You can reach her at dee@renaissoft.com, or find out more at http://www.Dee-AnnLeBlanc.com/.

Copyright Jupitermedia Corp. All Rights Reserved.