Specifications
shell> SCSI_BUS=0 # taken from listing 1 "scsibus0:"
shell> SCSI_ID=6 # taken from listing 1 "TOSHIBA XM−3401"
shell> SCSI_LUN=0
shell> cdrecord −v speed=2 dev=$SCSI_BUS,$SCSI_ID,$SCSI_LUN \
−data cd_image
# same as above, but shorter:
shell> cdrecord −v speed=2 dev=0,6,0 −data cd_image
For better readability, the coordinates of the writer are stored in three environment variables with natural
names: SCSI_BUS, SCSI_ID, SCSI_LUN.
If you use cdrecord to overwrite a CD−RW, you must add the option "blank=..." to erase the old content.
Please read the man page to learn more about the various methods to blank the CD−RW.
In times where everybody except me owns a 400 Mhz machine, people feed the output of mkisofs directly
into cdrecord:
shell> IMG_SIZE=`mkisofs −R −q −print−size private_collection/ 2>&1 \
| sed −e "s/.* = //"`
shell> echo $IMG_SIZE
shell> [ "0$IMG_SIZE" −ne 0 ] && mkisofs −r private_collection/ \
|cdrecord speed=2 dev=0,6,0
tsize=${IMG_SIZE}s −data −
# don't forget the s −−^ ^−− read data from STDIN
The first command is an empty run to determine the size of the image (you need the mkisofs from the
cdrecord distribution for this to work). You need to specify all parameters you will use on the final run (e.g.
−J or −hfs). Maybe your writer does not need to know the size of the image to be written, so you can leave
this dry run out. The printed size must be passed as a tsize−parameter to cdrecord (it is stored in the
environment variable IMG_SIZE). The second command is a sequence of mkisofs and cdrecord, coupled via
a pipe.
The
3.2 Writing audio CDs
Writing audio CDs is very similar to the steps described above for data CDs. You can choose between two
techniques: DAO or TAO. TAO (track at once) is less suitable for music, because you will hear clicks
between the individual tracks. It is described first anyways, because it is a little bit easier to deal with and
DAO is not available for all drives yet.
The main difference compared to writing data CD−Rs is the format of the images. ISO−9660 (or whatever
filesystem you prefer) would not be suitable, because no audio CD player is able to deal with filesystems.
Instead the audio data must be writen as "16 bit stereo samples in PCM coding at 44100 samples/second
(44.1 kHz)".
One utility to convert your sound files into the required format is sox. Its usage is straightforward:
CD−Writing HOWTO
3.2 Writing audio CDs 18