CD Recording Tips (Linux)
(January 2006)

This page presents some interesting tips for CD recording under Linux, using the cdrecord tool.
Note that most of the time one must be root to run cdrecord.
Table of contents

Erase a CD-RW

Burn the content of a directory

The ISO-9660 filesystem read ahead bug

Erase a CD-RW

shell> cdrecord blank=fast dev=ATAPI:1,0,0

Burn the content of a directory

Create the filesystem (cd.iso):
shell> mkisofs -J -r -o cd.iso my_directory
Check that the filesystem can be mounted (/mnt/tmp is an empty directory):
shell> mount cd.iso -o loop /mnt/tmp
Proceed with the burning:
shell> cdrecord -v speed=6 dev=ATAPI:1,0,0 cd.iso

The ISO-9660 filesystem read ahead bug

Symptoms

The symptoms of this bug can be :
shell> dd if=/dev/cdrecorder of=/dev/null
dd: reading `/dev/cdrecorder': Input/output error
7600++1 records in
7600+0 records out
15564800 bytes (16 MB) copied, 129,307 seconds, 120 kB/s
I found the solution to this problem on http://www.troubleshooters.com/linux/coasterless.htm.

The "read ahead bug" is mentionned in the man page of cdrecord :
padsize=#
	[...]
	Use this option if your CD-drive is not able to read the last sectors
	of a track or if you want to be able to read the CD on a Linux system
	with the ISO-9660 filesystem read ahead bug.
	[...]

Solution

Burn your CDROM with the options padsize=63s -pad -dao:
shell> cdrecord dev=ATAPI:1,0,0 padsize=63s -pad -dao my_filesystem.iso
Afterwards, in order to check this burning with dd, you must supply the exact block size, and block count.
Use the isoinfo tool to get these two values.
shell> isoinfo -d -i /dev/cdrecorder
CD-ROM is in ISO 9660 format
[...]
Logical block size is: 2048
Volume size is: 7483
[...]
shell> dd if=/dev/cdrecorder of=my_cdrom.iso bs=2048 count=7483
shell> cmp my_cdrom.iso my_filesystem.iso
CAVEAT !!
If you check your CD-ROM without specifying count=7483, then dd will read past these 7483 blocks and fill the output file with zeros.
And obviously the file my_cdrom.iso will be larger than the original my_filesystem.iso file (the extra zeros come from the 63s padding).