CD Recording Tips (Linux)
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
shell> cdrecord blank=fast dev=ATAPI:1,0,0
Create the filesystem (
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 symptoms of this bug can be :
- you just burned a new CDROM,
- this CDROM can be mounted normally,
- the files in this CDROM are exactly the same as those you intended to burn,
- BUT the
dd tool shows errors:
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 :
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.
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.
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
If you check your CD-ROM without specifying
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).