oreilly.comSafari Books Online.Conferences.


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.


cdrecord [general-options] dev=device [track-options] track1,track2...

Record data or audio compact discs. This program normally requires root access. It has a large number of options and settings. A number of useful examples can be found in the manpage.

General options

General option flags go directly after the cdrecord command. Options affecting the track arguments are placed after the device argument and before the track arguments themselves. The general options are:


Display the ATIP (Absolute Time In Pregroove) information for a disc. Only some drives allow you to read this information.


Erase data from a CD-RW in one of the following ways:


Display a possible list of blanking methods.


Erase all information on the disc. May take a long time.


Perform a quick erase of the disc, erasing only the PMA, TOC, and pregap.


Blank a track.


Unreserve a track previously marked as reserved.


Blank the tail of a track only.


Unclose the last session.


Blank the last session.


Check to see if there are valid drivers for the current drive. Returns 0 if the drive is valid.


Disk-at-once mode. Works only with MMC drives that support non-raw session-at-once modes.

--debug=n, -d

Set the debug level to an integer (greater numbers are more verbose), or use multiple -d flags as with the -v and -V flags.


Lets you specify a driver for your system. Suggested for experts only. The special drivers cdr_simul and dvd_simul are used for simulation and profiling tests.


Specify a comma-separated list of driver options. To get a list of valid options, use driveropts=help and --checkdrive.


Perform a dry run, doing all the steps of recording with the laser turned off. This will let you know whether the process is going to work.


Eject disc after recording. Some hardware may need to eject a disc after a dummy recording and before the actual recording.


Close ("fixate") the session, preventing future multisession recordings and allowing the disc to be played in standard audio CD players (some can also play a disc that has not been closed).


Override errors if possible. May allow you to blank an otherwise broken CD-RW.


Set the fifo buffer size to n, in bytes. You may use k, m, s, or f to specify kilobytes, megabytes, or units of 2048 and 2352 bytes, respectively. The default is 4 MB.

--kdebug=n, --kd=n

Set the kernel's debug notification value to n during SCSI command execution. Works through the scg-driver.


Load media and exit. Works with tray-loading mechanisms only.


Set the Media Catalog Number to n.


Get multisession information from the CD. Used only with multisession discs onto which you can still record more sessions.


Set to record in multisession mode. Must be present on all sessions but the last one for a multisession disc.


Do not close the disc after writing.


Attempt to reset the SCSI bus. Does not work on all systems.

-s, --silent

Silent mode. Do not print any SCSI error commands.


Set the speed to n, a multiple of the audio speed. Normally, cdrecord will get this from the CDR_SPEED environment variable. If your drive has trouble with higher numbers, try 0 as a value.


Set the timeout to n seconds. Defaults to 40.


Display the table of contents for the CD currently in the drive. Works for CD-ROM, as well as CD-R and CD-RW drives.


Scan SCSI devices.


Use .inf files to override audio options set elsewhere.


As with the -v, a verbose mode counter. However, this applies only to SCSI transport messages. This will slow down the application.


Verbose mode. Use one v for each level of verbosity. -vv would be very verbose, and -vvv would be even more so.


Print version information and exit.

The device argument

The device argument should be specified not as a file but as three integers that represent the bus, target, and logical unit, as in the cdrdao command. To check the options that are available, use the --scanbus option.

Track options and arguments

Track options may be mixed with track arguments, and normally apply to the track immediately after them or to all tracks after them. The track arguments themselves should be the files that you will be writing to the CD. Options are:


Write all tracks after this track in digital audio format (playable by standard CD players). If you do not use this flag or the --data flag, cdrecord will assume that .au and .wav files are to be recorded as raw audio and that all other files are data.


Write subsequent tracks in CDI format.


Record subsequent tracks as CD-ROM data. If you do not use this flag or the --audio flag, all files except for those that end in .wav or .au are assumed to be data.


Set the index list for the next track. The values should be increasing comma-separated integers, starting with index 1 and counting in sectors (75ths of a second). For example, you could set three indices in a track with index=0,750,7500 and they would occur at the beginning of the track, after 10 seconds, and after 100 seconds.


The size of the next track should match the size of the ISO-9660 filesystem. This is used when duplicating CDs or copying from raw-data filesystems.


Set the International Standard Recording Number for the track argument following this option.


Write all subsequent tracks in CD-ROM mode 2 format.


Do not insert blank data between data tracks following this flag. This is the default behavior.


Insert 15 sectors of blank data padding between data tracks. Applies to all subsequent tracks or until you use the --nopad argument, and is overridden by the padsize=n argument.


Insert n sectors of blank data padding after the next track. Applies only to the track immediately after it.


Declare that your data is in byte-swapped (little-endian) byte order. This is not normally necessary.


Set the size of the next track. Useful only if you are recording from a raw disk for which cdrecord cannot determine the file size. If you are recording from an ISO 9660 filesystem, use the --isosize flag instead.

--xa1, --xa2

Write subsequent tracks in CD-ROM XA mode 1 or CD-ROM XA mode 2 format.

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: