Burning CDs in Linux

Terminology

Kernel Requirements

User Space Programs

Command Line Burn (Data)

Command Line Burn (Audio)

GUI Tools

Terminology

Types of Compact Discs

CD-ROM

Burned by the manufacturer or in a publishing house

CD-R

Burned in a CD-R drive

One time only, but most newer drives support "multi-session" cds, allowing you to write a cd in stages

CD-RW

Rewritable a fixed number of times (usually around 100)

Terminology

Filesystems

ISO 9660

Limited to 8 levels of subdirectories

Maximum file name length of 32 characters

650MB capacity

Rock Ridge

ISO 9660 extension

Allows for longer filenames and deeper directory structure

Also stores Unix ownerships and permissions

Terminology

Filesystems (continued)

El Torito

Allows for bootable cd-roms (if the BIOS supports it)

HFS

Native Macintosh filesystem

Joliet

Microsoft extension to ISO9660 that allows long filenames (up to 64 characters)

Usable under Windows 9x/NT/2000 and Linux

Kernel Requirements

SCSI CD-Writers

CONFIG_SCSI=y (SCSI support)

CONFIG_BLK_DEV_SR=y (SCSI CD-ROM)

CONFIG_CHR_DEV_SG=y (Generic SCSI)

CONFIG_ISO9660_FS=y (ISO 9660 filesystem)

CONFIG_JOLIET=y (Joliet filesystem)

CONFIG_BLK_DEV_LOOP=y (Optional Loopback device)

Plus the driver for your SCSI card

The interface to your SCSI CD-R will usually be /dev/sr0

Kernel Requirements

IDE CD-R Drives

CONFIG_BLK_DEV_IDESCSI=y (SCSI emulation)

CONFIG_SCSI=y (SCSI support)

CONFIG_CHR_DEV_SG=y (Generic SCSI)

CONFIG_ISO9660_FS=y (ISO 9660 filesystem)

CONFIG_JOLIET=y (Joliet filesystem)

CONFIG_BLK_DEV_LOOP=y (Optional Loopback device)

You must pass the kernel "hdx=scsi" at boot time to allow the SCSI emulation to control your CD-R.

User Space Programs

Command Line Utils

mkisofs (ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/)

Create ISO-9660/Joliet/Rock Ridge/HFS filesystems on a cd

cdrecord (ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/)

Command-line util to burn cds, required by many GUI front ends

"cdrecord -scanbus" will autodetect your burner

cdrdao (http://www.ping.de/sites/daneb/cdrdao.html)

Command-line util to burn "Disc at once"

mkvcdfs (http://www.munich-vision.de/vcd/)

Command-line util to burn Video cds

User Space Progams

GUI Programs

x-cd-roast (www.xcdroast.org)

Probably the best, easiest to use, most full-featured

BurnIT (sunsite.auc.dk/BurnIT/)

Java front end to many different command line tools

CD-Tux

Ncurses-based cd burner

Many, many others. Check www.freshmeat.net

Command Line Burn (Data)

Step 1 - use mkisofs to create the cd-image

mkisofs -(r|J) -o /tmp/cdimage.img /whatever/

Step 2 (optional) - mount the image and inspect it

mount -t iso9660 -o ro,loop=/dev/loop0 /tmp/cdimage.img /cdrom

umount /cdrom

Step 3 - copy the image to a cd-r

cdrecord -v speed=4 dev=0,0,0 -data /tmp/cdimage.img

Command Line Burn (Audio)

Step 1 - Convert your mp3 files to the right format

for i in *.mp3 {

filename=`echo $i | cut -d. -f1`

mpg123 --cdr - "$i" > $filename.cdr

}

Step 2 - Copy the audio files to the drive

cdrecord -v -pad speed=4 dev=0,0,0 -audio *.cdr

GUI Tools

Example of x-cd-roast

Adam Haeder

2001-04-03T13:58:39