Command-line gems: cdrecord

Aug 15, 11:37 am

Most Linux distros are made available as a series of ISO files. To become useful these must be burned to CD and then booted from, or the ISO files must mounted in some way, perhaps as part of a virtual machine setup.

Most Linux desktop environments offer the ability to burn a CD image straight from the desktop. Under GNOME you can right-click and select Write to Disk, for example. This is nifty but I prefer to write CDs straight from the command-line, using the cdrecord command.

cdrecord needs a handful of "optional" command switches to work effectively. At the very least it's wise need to tell cdrecord what speed to burn the disc at, and telling it what hardware device to use is obligatory. Unless you have a particularly complex system, it's likely your CD/DVD writer will be the first device on the secondary IDE channel—identified by Linux as /dev/hdc.

The following will burn the specified .iso image file at 4x speed and using the CD/DVD writer drive attached to /dev/hdc:

cdrecord dev=/dev/hdc speed=4 -v imagename.iso

You should match the write speed setting to the speed of your drive and also the rated speed the media you're using. Be aware that ISOs can prove unreliable if burned at too high a speed, even if ordinary data CDs work fine when burned at similar speeds. I never burn CD ISOs at more than 4x.

The -v command option switches on one of cdrecord's various verbose modes. Without this, cdrecord won't report back to you at all—not even if you have a bad burn.

Prior to actually burning it's a good idea to use the -dummy command option to ensure that the burn will work. This effectively does a test burn; the drive is operated as if a burn is taking place but the laser isn't activated.

There's a handful of important caveats that apply to those using DVD+-R/RW drives, or wanting to burn DVD rather than CD ISO images.

Some distros use a special version of cdrecord that's tweaked for DVD writer drive use, and which must be used for both CD and DVD ISO image burning. For example, SUSE Linux uses cdrecord-dvd. Additionally, some distros use a different command when it comes to burning DVD ISO images. Under Ubuntu and Fedora Core, the growisofs command is preferred.

Note that it's well worth reading cdrecord's man page because the program is packed with features and options.


    1. None says:

      Note that some high-speed CDR media has a floor speed as well; it’s not safe to burn below around 16x on some 48x or 52x media. cdrecord usually detects this and ups your speed if it’s too low.




Add your comments

Please keep your comments relevant to this blog entry: inappropriate or purely promotional comments may be removed. To add hyperlink, please follow this example: "your link text":http://your.link.url