LinuxCommandLibrary

readcd

Read data from optical discs (CD/DVD)

TLDR

Read a cd and copy it to a file

$ readcd dev=[/dev/srX] f=[path/to/file.iso]
copy

SYNOPSIS

readcd [options] dev=device [arguments]

PARAMETERS

dev=device
    Specifies the SCSI device or device alias (e.g., /dev/sr0, 0,0,0).

f=file
    Specifies the output file for the read data. Use - for standard output.

sectors=N
    Reads N sectors from the disc. Also recognized as size=N.

start=N
    Starts reading from sector N.

audio
    Instructs readcd to read audio tracks (CDDA) instead of data tracks.

data
    Instructs readcd to read data tracks (default behavior).

speed=N
    Sets the reading speed of the drive to Nx.

noerror
    Continues reading even if read errors are encountered, attempting to skip bad blocks. Useful for damaged media.

retries=N
    Specifies the number of times to retry reading a bad block (default is 0).

cuefile=file
    Creates a CUE sheet file that describes the disc's layout and tracks.

dummy
    Performs a test read without actually writing data to the output file or disc.

verbose
    Increases the verbosity of the output, showing more details about the operation progress.

debug
    Activates debug output, providing highly detailed information for troubleshooting.

timeout=N
    Sets the SCSI command timeout in seconds.

ts=sectorsize
    Sets the target sector size for reading (e.g., 2048 bytes for data, 2352 bytes for audio).

DESCRIPTION

The readcd command is a versatile utility used for reading data and audio tracks from CD-ROM, DVD-ROM, and BD-ROM media. It is part of the `cdrtools` (or `wodim`) software suite, which provides comprehensive tools for disc mastering. Unlike simpler commands like `dd`, readcd offers advanced capabilities for low-level disc access, making it particularly useful for creating exact ISO images, extracting audio tracks (CDDA), and attempting data recovery from physically damaged or scratched discs. It supports various block sizes, error handling mechanisms, and precise control over the reading process, including specifying start sectors, total sectors, and read speed. This command is often employed when a more robust and granular approach to disc reading is required beyond standard filesystem mounting or basic imaging utilities.

CAVEATS

readcd typically requires direct SCSI access to the optical drive, which might necessitate elevated permissions (e.g., running as root or having appropriate udev rules). While powerful for data recovery, it cannot bypass strong copy protection mechanisms, and its success on severely damaged media depends on the extent and type of damage. For simple ISO imaging of healthy discs, the dd command might be a more straightforward alternative. Be aware that different Linux distributions might package `readcd` as part of the `cdrtools` suite or its `wodim` fork, which could lead to minor behavioral differences.

HISTORY

readcd is an integral part of the `cdrtools` suite, originally developed by Joerg Schilling. This suite was pioneering in providing robust CD/DVD burning and reading capabilities for Unix-like operating systems, with its development beginning in the mid-1990s. The core functionality of `readcd`, enabling low-level disc access and comprehensive error handling, has remained consistent. Due to licensing debates (specifically, the CDDL license used by `cdrtools` being incompatible with the GPL license preferred by many Linux distributions), forks like `wodim` (WOrk-aLike DIsk Mastering) were created and adopted by some distributions. Despite these changes, readcd has remained a crucial tool for specialized tasks such as audio extraction and data forensics, long after optical media became less common for general data storage.

SEE ALSO

cdrecord(1), wodim(1), mkisofs(1), dd(1), isoinfo(1)

Copied to clipboard