CD Burning and Ripping in Linux

For CD burning and ripping my weapons of choice are dd, cdparanoia and cdrecord.


To rip an ISO image directly from a cd:

dd if=/dev/cdrom of=cdimage.iso

Note: This does not work audio cd's.

Rip Audio Tracks

Rip one track. Namely, track #3

cdparanoia -v -d /dev/cdrom "03" track03.wav

Rip from beggining of disc up to track 3:

cdparanoia -v -d /dev/cdrom -- "-3" tracks1-3.wav

Rip from track 1, 30 seconds into it to 45 seconds in:

cdparanoia -v -d /dev/cdrom "1[00:30]-1[00:45]" track1-partial.wav

Obviously, to rip an entire cd, you need to know how many tracks. Then setup a for loop to rip em to separate files. So for a 15 track cd:

for track in `seq 1 15`; do
	cdparanoia -v -d /dev/cdrom "$track" track-$track.wav

Note: for cdparanoia, -v is verbose and -d /dev/cdrom specifies the device.

I made a script that queries CDDB and then creates mp3's from the cd in ipod-like format (Artist/Year - Album/01 - Track Name.mp3)

Burn ISO

cdrecord -v speed=8 dev=ATAPI:0,0,0 -isosize cdimage.iso

Burn Audio

cdrecord -v speed=8 dev=ATAPI:0,0,0 -audio track-*.wav *

If your .wav files were not ripped form another cd (eg. you made these .wav files yourself somehow) then they need to be padded:

cdrecord -v speed=8 dev=ATAPI:0,0,0 -audio -pad track-*.wav *

Note: to find your device (eg ATAPI:0,0,0) do cdrecord -scanbus. Also, the SCSI emulation (the thing that requires the device as 0,0,0) is being phased out. Many newer distros will accept the actual location of the device: dev=/dev/cdrom.

Make an ISO

Make an ISO filesystem out of files in a directory (that you want on a cd):

mkisofs -R -o cdimage.iso my_directory_that_i_want_on_a_cd

Than burn that .iso to cd.