Software for writing CD-Recordables under Linux has been available for some time. The cdrecord utility, one of the preeminent tools for writing CDs, is very stable despite its current alpha status. Two important companion utilities, mkisofs and cdda2wav, have recently been included in the cdrecord distribution. With these utilities, cdrecord is now all you need for preparing and writing CD-Recordables under Linux.

cdrecord is maintained by Jörg Schilling. The home page for the utility is:

http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html

The current release when this text was written was cdrecord-1.8a24. A copy of this distribution is on the CD-ROM included with this text in the /cdrecord directory. However, it is advisable to examine the web site for a newer version.

On Linux, cdrecord works with the SCSI generic devices (/dev/sg?). Support for these devices must be enabled in the kernel. Also, cdrecord uses SCSI emulation to address IDE devices. Finally, cdrecord requires Inter-Process Communication facilities (IPC) to be enabled in the kernel. The standard Red Hat distribution kernels laid down by the installer contain all the support for these features that is required.

Jörg Schilling complains bitterly in the documentation for cdrecord about the quality (or lack thereof) of the SCSI implementation in the Linux kernel. Let's hope that this issue is resolved to the satisfaction of all concerned.

Configuration

Before cdrecord can be used, the Linux kernel must be properly configured to address a CD-Recorder. Extra kernel functionality will be required if IDE CD-Recorders are in use.

SCSI Considerations

SCSI CD-Recoreders are ideal for use with cdrecord. The kernel will require support for the SCSI generic devices and the /dev/sg? devices must exist. Also, if cdrecord will be used with an IDE recorder, SCSI emulation must be configured for the drive.

If the device files in the /dev directory have been damaged, they can be rebuilt with the MAKEDEV script that is itself in the /dev directory. In this case, the correct syntax to rebuild the SCSI generic devices is MAKEDEV sg.

The kernel will also require basic Inter-Process Communication (IPC) services. Loopback device support is also recommended as it allows testing of CD images on the hard drive before they are burned to the CD-ROM.

All of this support is available in the Red Hat distribution kernel. For information on kernel options, see Chapter 10: Building the Linux Kernel.

IDE Considerations

Starting with Red Hat Linux 6.0, there is no longer a need to build a specialized kernel to use an IDE CD recorder (oh joy!). All required functionality can be achieved under the standard Red Hat distribution kernel with LILO and kernel modules.

IDE CD-Recordable drives must use the “ide-scsi” kernel module to emulate a SCSI CD-ROM drive with the SCSI generic devices. This is accomplished through LILO and the modprobe utility, but a quick review of the IDE device names under Linux is in order.

As a Linux administrator ought to know, there are usually two IDE channels on most PC motherboards. Each IDE channel can host up to two IDE devices, one master and one slave. The /dev entries for these devices are shown below:

Primary Channel Master/dev/hda
Primary Channel Slave/dev/hdb
Secondary Channel Master/dev/hdc
Secondary Channel Slave/dev/hdd

In most modern PCs, the hard drive is installed as the master on the primary channel (/dev/hda), while the CD-ROM (read-only) drive is normally installed as the master on the secondary channel (/dev/hdc). It can be disconcerting to have a CD-ROM drive referred to as “Hard Drive C,” and there is ample reason to install a soft link from /dev/cdrom to /dev/hdc (not only for clarity, as some programs, such as audio CD players, require this link). Normally, a CD-Recordable drive is installed in addition to the read-only drive as the slave on the secondary channel (/dev/hdd), since CD-Recordable drives are much slower at reading CD-ROMs than the read-only drives. Some CD-Recordable drives work better if they are installed as IDE master devices. However, in this section, we will assume that the CD-Recordable drive is installed as a slave on the secondary channel.

Given the above configuration, with the CD-Recordable drive as the slave device on the secondary channel (/dev/hdd), the first step in configuring the drive with SCSI emulation is to pass “hdd=ide-scsi” as an argument to the kernel at boot time (if /dev/hdd is not the CD-Recordable drive, substitute another device name). This is normally done through LILO (unless another bootloader is in use, such as loadlin, MILO, or SILO, but these configurations are not covered in this text). Below is an example /etc/lilo.conf that passes this argument:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
other=/dev/hda1
	label=dos
	table=/dev/hda
image=/boot/vmlinuz-2.2.5-22
	label=linux
	root=/dev/hda5
	read-only
	append="hdd=ide-scsi"

This example LILO configuration boots a DOS variant by default, but when Linux is booted, the “hdd=ide-scsi” string is passed as an argument to the Linux kernel (with the “append” option on the last line of the file). This is not the only step required to convert the IDE drive into a SCSI-emulated drive. After booting Linux with the new kernel argument, root must issue the following command to complete the emulation:

modprobe ide-scsi

The kernel will then report the status of the SCSI initialization as it probes SCSI IDs and LUNs (a LUN is a “Logical Unit Number”). It should identify the manufacturer and model number of the IDE drive as the probe progresses.

Creating/Duplicating Data Discs

Simple data discs are composed of a single data track. The data is held in the ISO9660 file system format. ISO9660 supports only 8.3 filenames, but longer filenames can be implemented by using extensions to ISO9660. These extensions also permit the use of soft links and permissions that are common to UNIX file systems.

Compiling and Installing cdrecord

The home page for cdrecord can be found at the following website:

http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html

It is suggested that the latest version be downloaded and installed from this location. Should this be impractical, a copy of cdrecord-1.8a24 can be found in the cdrecord directory on the CD-ROM included with this text (which will most likely be outdated by the time that this chapter goes to print). Use the following commands to install the older version:

tar xvzf cdrecord-1.8a24.tar.gz
cd cdrecord-1.8
./Gmake.linux
make install

The steps for installing later versions may have changed; the user may be required to improvise.

Using dd to Create CD Images

If a soft link is created from /dev/cdrom pointing to the appropriate CD-ROM device (which is usually /dev/hdc or /dev/scd0), a copy of a CD-ROM data disc can be sent to the hard drive with the following command:

dd if=/dev/cdrom of=/tmp/cdimage.raw

CD-ROM images can be very large; make sure there is enough space in the target file system to hold the image. Use the df command to check the space available in all mounted file systems, from which it follows that df can also be used to determine the size of a CD-ROM if it is first mounted into the file system. The above command would probably write the image into the root file system, unless /tmp was declared as a separate file system at installation time.

One of the author's IDE drives does not properly size tracks and causes dd to emit “dd: /dev/hdc: Input/output error” messages each time it is used. While these errors are not fatal and result in no corruption of data, the errors are supressed by using the SCSI-emulated drive to read the track.

The image created in the previous step can be tested by mounting it as a separate file system using the loopback device:

mount /tmp/cdimage.raw -r -o loop /mnt

We have omitted the “-t iso9660” option to the mount command above as this filesystem type is automatically detected. However, some configurations might require this option.

After the mount, the /mnt directory should then appear to be an exact duplicate of the source CD-ROM.

Using mkisofs to Create CD Images

The mkisofs utility, written by Eric Youngdale, is used to prepare data images of an active file system which can be written to a blank CD-Recordable disc. mkisofs is part of the cdrecord distribution, and they are compiled and installed together.

The mkisofs command is analogous to tar, in that it prepares an uncompressed “archive” of files in the ISO9660 format. This “archive” can be burned directly to a blank CD-Recordable disc.

A simple invocation of mkisofs follows:

/opt/schily/bin/mkisofs -o /tmp/cdimage.raw .

The previous command will store the current directory, and all of its subdirectories, in a binary ISO9660 image that is suitable for writing to a CD-Recordable. Running the following command will mount the ISO9660 image on the /mnt directory so that it might be examined and verified:

mount /tmp/cdimage.raw -r -o loop /mnt

If the output file is mounted in this manner, it will soon be discovered that long file names have been trimmed. The ISO9660 format supports only 8.3 filenames (8 characters, followed by a dot, followed by an optional 3 character extension, just like the old days of DOS). Longer filenames can be accurately stored within an ISO9660 image by using “Rock Ridge” extensions with the -r parameter to mkisofs. A new image using these extensions can be created after the old image is unmounted.

umount /mnt
/opt/schily/bin/mkisofs -r -o /tmp/cdimage.raw .

The very best set of options to properly record the attributes of long file names and other UNIX filesystem particulars is a mkisofs with the -T and -J parameters in addition to -r. The -T option records additional directory information in a “TRANS.TBL” file in each directory, and -J generates “Joliet” directory entries, which are useful on Windows platforms.

/opt/schily/bin/mkisofs -r -T -J -o /tmp/cdimage.raw .

A volume label can be added to the CD image with the -V parameter:

/opt/schily/bin/mkisofs -r -T -J -V "Personal Files" -o /tmp/cdimage.raw .

A CD-Recordable can even be made “bootable” on i386 systems with the additional -b and -c arguments:

/opt/schily/bin/mkisofs -r -T -J -V "Personal Files" -b boot/boot.img \
	-c boot/boot.catalog -o /tmp/cdimage.raw .

The boot/boot.img file is a pre-existing image of a bootable floppy which can be generated with dd. The boot/boot.catalog is a file created by mkisofs within the source file system (be careful - it will overwrite any prexisting file with the same name and location). This bootable CD format, called the “El Torito” extension, requires BIOS support (i.e., older PCs with i386-family processors will probably not be able to boot off such CDs because the BIOS is too antiquated to support El Torito).

Burning a data image to a CDR with cdrecord

A data image, obtained from either dd or mkisofs, can be tested for burning with a command similar to the following:

/opt/schily/bin/cdrecord -dummy -v speed=2 dev=0,0,0 /tmp/cdimage.raw

The “dev=0,0,0” option above indicates the SCSI bus number, SCSI ID, and the LUN of the CD-Recorder. If the recorder at ID 5 on the third SCSI controller was desired, its dev would be 2,5,0. IDE drives will probably use device 0,0,0 if no other SCSI peripherals are configured in the Linux environment. The kernel will also report the address used by the drive(s) when the SCSI drivers are loaded (i.e., when modprobe ide-scsi command is executed, or when the module for a SCSI controller is loaded, or at boot when a SCSI driver which is compiled into the kernel is initialized - check /var/log/messages if there are doubts as to the location of the CD-Recordable drive). The “speed=2” option above indicates the speed that data should be written to the blank CD-R; use the maximum speed of which your drive is capable unless you have problems.

When the above command is run, cdrecord will simulate a complete write to the CD-Recorder, which will probably take a long time (everything is done except the actual firing of the laser). Do not be alarmed at the countdown; the disc will not be recorded. Output similar to the following should appear:

Cdrecord release 1.8a24 Copyright (C) 1995-1999 Jörg Schilling
TOC Type: 1 = CD-ROM
scsidev: '0,0,0'
scsibus: 0 target: 0 lun: 0
atapi: 1
Device type    : Removable CD-ROM
Version        : 0
Response Format: 1
Vendor_info    : 'MITSUMI '
Identifikation : 'CR-2801TE       '
Revision       : '1.06'
Device seems to be: Philips CDD-522.
Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
Driver flags   : SWABAUDIO
Drive buf size : 409600 = 400 KB
FIFO size      : 4194304 = 4096 KB
Track 01: data   73 MB
Total size:      84 MB (08:21.08) = 37581 sectors
Lout start:      84 MB (08:23/06) = 37581 sectors
Current Secsize: -1
ATIP info from disk:
  Indicated writing power: 5
  Is not unrestricted
  Is not erasable
  ATIP start of lead in:  -11325 (97:31/00)
  ATIP start of lead out: 336225 (74:45/00)
Disk type: Cyanine, AZO or similar
Manuf. index: 22
Manufacturer: Ritek Co.
Blocks total: 336225 Blocks current: 336225 Blocks remaining: 298644
RBlocks total: 345460 RBlocks current: 345460 RBlocks remaining: 307879
Starting to write CD/DVD at speed 2 in dummy mode for single session.
Last chance to quit, starting dummy write in 1 seconds.
Waiting for reader process to fill input-buffer ... input-buffer ready.
Starting new track at sector: 0
Track 01:  73 of  73 MB written (fifo 100%).
Track 01: Total bytes read/written: 76961792/76961792 (37579 sectors).
Writing  time:  255.390s
Fixating...
WARNING: Some drives don't like fixation in dummy mode.
Fixating time:    0.006s
/opt/schily/bin/cdrecord: fifo had 2349 puts and 2349 gets.
/opt/schily/bin/cdrecord: fifo was 0 times empty and 2211 times full, min
	fill was 97%.

An important point to make about the process of writing CD-R discs is the FIFO (First-In, First-Out) buffer. The CD-R drive has a small amount of memory which is used as a buffer as it writes to the blank CD-R. The buffer is filled as the computer writes data to the drive, and emptied as the drive writes the data to the CD-R. The buffer must not be allowed to go empty until the disc is completely written; if the FIFO empties prematurely, the disc will be wasted. For this reason, it is imperative that the Linux system be lightly loaded while the recording of the blank CD-R is taking place. If cdrecord is forced to compete with other system processes for access to the CPU or the I/O system, the CD-R media may be wasted (instant coaster!). cdrecord does augment the buffer on the CD-Recordable drive with another FIFO in system memory, but it is advisable not to tempt fate by using cdrecord on a system that is too busy.

It is also not normally safe to burn an image that is mounted on an NFS file system, also for fears of a FIFO underrun. Options are available that will control the FIFO, which may allow slower file systems to perform acceptably.

A data image can be written to a CD-Recordable disc by omitting the “-dummy” option to cdrecord. Do not write the image until a successful test run of cdrecord is achieved. An example which will perform a write follows:

/opt/schily/bin/cdrecord -v speed=2 dev=0,0,0 /tmp/cdimage.raw

There are many more options to cdrecord (more than there are to ls, as the author has pointed out). Refer to the online manual page and the distribution notes for further information.

Creating/Duplicating Audio Discs

This section relies upon the cdda2wav companion utility in the cdrecord distribution. cdda2wav was written by Heiko Eissfeldt. It is compiled and installed at the same time as cdrecord.

cdda2wav makes an exact digital copy of the data on the audio CD. Both the right and left channels are sampled at 44.1 kHz with 16-bit linear quantization which, according to the Nyquist Sampling Theory, gives a useful audio bandwidth of 20kHz without aliasing and allowing for high-end filter roll-off. (I guess that I didn't get that electrical engineering degree for nothing.)

Preparing WAV Images of an Audio CD with cdda2wav

cdda2wav normally encapsulates audio data from a CD in the WAV format (a format in common use on the Windows platform). cdda2wav can use a number of other formats, and conversion between the formats is often simply an exercise in the options to dd. In this text, we will work with WAV.

cdda2wav is called slightly differently if it is used on IDE equipment, rather than SCSI. The following command will copy each track on an audio CD from a SCSI CD-ROM into separate WAV files (with filenames proceeding up from audio_01.wav) in the current directory:

/opt/schily/bin/cdda2wav -D 0,0,0 -S 8 -B

If the -B option above is omitted, the data is stored in one big WAV file, rather than in separate files (in other words, you will almost always want to use -B). The other options, although similar to those for cdrecord, are not identical. The argument to -D is the SCSI Bus:ID:LUN as before. -S specifies the speed that should be used (the drive used in this case is an 8-speed read, 2-speed write). The alternate invocation for IDE drives follows:

/opt/schily/bin/cdda2wav -I cooked_ioctl -D /dev/hdc -S 36 -B

Above, the -Icooked_ioctl option has been added, and the parameter to the -D option now points to the device file for the drive.

Rather than reading the entire disc, it is sometimes useful to read only a few tracks. This is accomplished with the -t option:

/opt/schily/bin/cdda2wav -I cooked_ioctl -D /dev/hdc -S 36 -B -t 3+5

The above command reads only tracks 3 through 5. Below is the output that should be expected:

724992 bytes buffer memory requested, 4 buffers, 75 sectors
#Cdda2wav version schily0.6_linux_2.2.5-15_i686_i686 real time sched.
	soundcard support
AUDIOtrack pre-emphasis  copy-permitted tracktype channels
      1-24           no              no     audio    2
Table of Contents: total tracks:24, (total time 69:13.30)
  1.( 1:51.53),  2.( 2:39.65),  3.( 1:07.10),  4.( 4:31.15),  5.( 0:36.72)
  6.( 1:16.38),  7.( 2:39.22),  8.( 0:48.15),  9.( 1:20.65), 10.( 2:23.70)
 11.( 1:30.00), 12.( 2:05.70), 13.( 2:08.45), 14.( 3:53.40), 15.( 5:53.60)
 16.( 1:53.55), 17.( 3:43.18), 18.( 3:58.62), 19.( 4:45.65), 20.( 3:51.18)
 21.( 4:39.12), 22.( 2:10.48), 23.( 3:00.10), 24.( 6:20.45),
Table of Contents: starting sectors
  1.(      32),  2.(    8410),  3.(   20400),  4.(   25435),  5.(   45775)
  6.(   48547),  7.(   54285),  8.(   66232),  9.(   69847), 10.(   75912)
 11.(   86707), 12.(   93457), 13.(  102902), 14.(  112547), 15.(  130062)
 16.(  156597), 17.(  165127), 18.(  181870), 19.(  199782), 20.(  221222)
 21.(  238565), 22.(  259502), 23.(  269300), 24.(  282810), lead-out(  311355)
CDDB discid: 0x47103718
CD-Text: not detected
CD-Extra: not detected
samplefiles size total will be 66201876 bytes. 3 audio tracks
recording 375.02933 seconds stereo with 16 bits @ 44100.0 Hz ->'audio'...
overlap:min/max/cur, jitter, percent_done:
 1/ 1/ 1/      0  18%  track  3 successfully recorded
 1/ 1/ 1/      0  90%  track  4 successfully recorded
 1/ 1/ 1/      0 100%
  track  5 successfully recorded

If a single numeric argument is passed with -t, the digital transfer of audio data begins with the track number specified and proceeds to the end of the disc. If two numeric arguments are passed, the transfer begins at the track of the first argument and concludes with the track of the last argument. The tracks are numbered starting at 1. The -t 3+5 option above starts recording at track 3 and ceases at the conclusion of track 5.

cdda2wav will also record information about the CDDB entry for the CD. All audio CDs have a unique serial number. An international Internet database exists that contains album titles, artists, and track titles for a majority of the audio compact discs that have been released. A perl script is included with cdda2wav called tracknames.pl. This script can be used to give useful names to the WAV files produced by cdda2wav - it will write a small shell script that can be used to rename the audio tracks. However, before it will run, the command interpreter in the first line of the script must be changed to /usr/bin/perl. Obviously, scans of this type will only work if your Linux system is connected to the Internet. Following is an example run of tracknames.pl:

# tracknames.pl us.cddb.com 8880 < audio.cddb
cddb query 47103718 24 182 8560 20550 25585 45925 48697 54435 66382 69997
	76062 86857 93607 103052 112697 130212 156747 165277 182020 199932
	221372 238715 259652 269450 282960 4150
Connected.
201 cddb1.cddb.com CDDBP server v1.4.1b14PL1 ready at Sun Aug 22 23:21:33 1999

cddb hello root localhost.localdomain billo-scan 0.1
200 Hello and welcome root@localhost.localdomain running billo-scan 0.1.

cddb query 47103718 24 182 8560 20550 25585 45925 48697 54435 66382 69997
	76062 86857 93607 103052 112697 130212 156747 165277 182020 199932
	221372 238715 259652 269450 282960 4150
200 classical 47103718 Modest Mussorgsky / Maurice Ravel /
	Pictures at an Exhibition / Ma Mhre l'Oye / Rapsodie Espagnole

cddb read classical 47103718
210 classical 47103718 CD database entry follows (until terminating `.')

Modest Mussorgsky / Maurice Ravel / Pictures at an Exhibition / Ma Mhre
Maurice Ravel
Modest Mussorgsky
l'Oye / Rapsodie Espagnole
Rapsodie Espagnole
l'Oye
Track match Rapsodie_Espagnole-01-Promenade
Track match Rapsodie_Espagnole-02-Gnomus
Track match Rapsodie_Espagnole-03-Promenade
Track match Rapsodie_Espagnole-04-Il_vecchio_castello
Track match Rapsodie_Espagnole-05-Promenade
Track match Rapsodie_Espagnole-06-Tuileries
Track match Rapsodie_Espagnole-07-Bydlo
Track match Rapsodie_Espagnole-08-Promenade
Track match Rapsodie_Espagnole-09-Ballet_des_Petits_Poussins_dans_leurs_Coques
Track match Rapsodie_Espagnole-10-Samuel_Goldenberg_und_Schmuyle
Track match Rapsodie_Espagnole-11-Limoges__Le_Marchi
Track match Rapsodie_Espagnole-12-Catacombae__Sepulchrum_Romanum
Track match Rapsodie_Espagnole-13-Cum_mortuis_in_lingua_mortua
Track match Rapsodie_Espagnole-14-La_Cabane_de_Baba-Yaga_sur_des_Pattes_de_Poule
Track match Rapsodie_Espagnole-15-La_Grande_Porte_de_Kiev
Track match Rapsodie_Espagnole-16-Pavane_de_La_Belle_au_Bois_Bormant
Track match Rapsodie_Espagnole-17-Petit_Poucet
Track match Rapsodie_Espagnole-18-Laideronnette,_Impiratrice_des_Pagodes
Track match Rapsodie_Espagnole-19-Les_Entretiens_de_la_Belle_et_la_Bjte
Track match Rapsodie_Espagnole-20-Le_Jardin_Fierique
Track match Rapsodie_Espagnole-21-Prilude_`_la_Nuit
Track match Rapsodie_Espagnole-22-Malaguena
Track match Rapsodie_Espagnole-23-Habanera
Track match Rapsodie_Espagnole-24-Feria
quit
230 cddb1.cddb.com Closing connection.  Goodbye.

mv 'audio_01.wav' 'Rapsodie_Espagnole-01-Promenade.wav'
mv 'audio_02.wav' 'Rapsodie_Espagnole-02-Gnomus.wav'
mv 'audio_03.wav' 'Rapsodie_Espagnole-03-Promenade.wav'
mv 'audio_04.wav' 'Rapsodie_Espagnole-04-Il_vecchio_castello.wav'
mv 'audio_05.wav' 'Rapsodie_Espagnole-05-Promenade.wav'
mv 'audio_06.wav' 'Rapsodie_Espagnole-06-Tuileries.wav'
mv 'audio_07.wav' 'Rapsodie_Espagnole-07-Bydlo.wav'
mv 'audio_08.wav' 'Rapsodie_Espagnole-08-Promenade.wav'
mv 'audio_09.wav' \
	'Rapsodie_Espagnole-09-Ballet_des_Petits_Poussins_dans_leurs_Coques.wav'
mv 'audio_10.wav' 'Rapsodie_Espagnole-10-Samuel_Goldenberg_und_Schmuyle.wav'
mv 'audio_11.wav' 'Rapsodie_Espagnole-11-Limoges__Le_Marchi.wav'
mv 'audio_12.wav' 'Rapsodie_Espagnole-12-Catacombae__Sepulchrum_Romanum.wav'
mv 'audio_13.wav' 'Rapsodie_Espagnole-13-Cum_mortuis_in_lingua_mortua.wav'
mv 'audio_14.wav' \
    'Rapsodie_Espagnole-14-La_Cabane_de_Baba-Yaga_sur_des_Pattes_de_Poule.wav'
mv 'audio_15.wav' 'Rapsodie_Espagnole-15-La_Grande_Porte_de_Kiev.wav'
mv 'audio_16.wav' 'Rapsodie_Espagnole-16-Pavane_de_La_Belle_au_Bois_Bormant.wav'
mv 'audio_17.wav' 'Rapsodie_Espagnole-17-Petit_Poucet.wav'
mv 'audio_18.wav' 'Rapsodie_Espagnole-18-Laideronnette,_Impiratrice_des_Pagodes.wav'
mv 'audio_19.wav' \
	'Rapsodie_Espagnole-19-Les_Entretiens_de_la_Belle_et_la_Bjte.wav'
mv 'audio_20.wav' 'Rapsodie_Espagnole-20-Le_Jardin_Fierique.wav'
mv 'audio_21.wav' 'Rapsodie_Espagnole-21-Prilude_`_la_Nuit.wav'
mv 'audio_22.wav' 'Rapsodie_Espagnole-22-Malaguena.wav'
mv 'audio_23.wav' 'Rapsodie_Espagnole-23-Habanera.wav'
mv 'audio_24.wav' 'Rapsodie_Espagnole-24-Feria.wav'

Fans of classical music will immediately recognize a small problem with the database entry for this CD; discs with multiple works may have inappropriate track titles (tracks 1-15 of this disc have absolutely nothing to do with Ravel's Rhapsodie Espagnole).

In any case, tracknames.pl has left a small script called backup.sh in the directory containing a set of commands. Below are its contents for this disc:

mv audio_01.wav Rapsodie_Espagnole-01-Promenade.wav
mv audio_02.wav Rapsodie_Espagnole-02-Gnomus.wav
mv audio_03.wav Rapsodie_Espagnole-03-Promenade.wav
mv audio_04.wav Rapsodie_Espagnole-04-Il_vecchio_castello.wav
mv audio_05.wav Rapsodie_Espagnole-05-Promenade.wav
mv audio_06.wav Rapsodie_Espagnole-06-Tuileries.wav
mv audio_07.wav Rapsodie_Espagnole-07-Bydlo.wav
mv audio_08.wav Rapsodie_Espagnole-08-Promenade.wav
mv audio_09.wav \
	Rapsodie_Espagnole-09-Ballet_des_Petits_Poussins_dans_leurs_Coques.wav
mv audio_10.wav Rapsodie_Espagnole-10-Samuel_Goldenberg_und_Schmuyle.wav
mv audio_11.wav Rapsodie_Espagnole-11-Limoges__Le_Marchi.wav
mv audio_12.wav Rapsodie_Espagnole-12-Catacombae__Sepulchrum_Romanum.wav
mv audio_13.wav Rapsodie_Espagnole-13-Cum_mortuis_in_lingua_mortua.wav
mv audio_14.wav \
	Rapsodie_Espagnole-14-La_Cabane_de_Baba-Yaga_sur_des_Pattes_de_Poule.wav
mv audio_15.wav Rapsodie_Espagnole-15-La_Grande_Porte_de_Kiev.wav
mv audio_16.wav Rapsodie_Espagnole-16-Pavane_de_La_Belle_au_Bois_Bormant.wav
mv audio_17.wav Rapsodie_Espagnole-17-Petit_Poucet.wav
mv audio_18.wav Rapsodie_Espagnole-18-Laideronnette,_Impiratrice_des_Pagodes.wav
mv audio_19.wav Rapsodie_Espagnole-19-Les_Entretiens_de_la_Belle_et_la_Bjte.wav
mv audio_20.wav Rapsodie_Espagnole-20-Le_Jardin_Fierique.wav
mv audio_21.wav Rapsodie_Espagnole-21-Prilude_`_la_Nuit.wav
mv audio_22.wav Rapsodie_Espagnole-22-Malaguena.wav
mv audio_23.wav Rapsodie_Espagnole-23-Habanera.wav
mv audio_24.wav Rapsodie_Espagnole-24-Feria.wav
mv audio_01.wav Rapsodie_Espagnole-01-Promenade.wav
mv audio_02.wav Rapsodie_Espagnole-02-Gnomus.wav
mv audio_03.wav Rapsodie_Espagnole-03-Promenade.wav
mv audio_04.wav Rapsodie_Espagnole-04-Il_vecchio_castello.wav
mv audio_05.wav Rapsodie_Espagnole-05-Promenade.wav
mv audio_06.wav Rapsodie_Espagnole-06-Tuileries.wav
mv audio_07.wav Rapsodie_Espagnole-07-Bydlo.wav
mv audio_08.wav Rapsodie_Espagnole-08-Promenade.wav
mv audio_09.wav \
	Rapsodie_Espagnole-09-Ballet_des_Petits_Poussins_dans_leurs_Coques.wav
mv audio_10.wav Rapsodie_Espagnole-10-Samuel_Goldenberg_und_Schmuyle.wav
mv audio_11.wav Rapsodie_Espagnole-11-Limoges__Le_Marchi.wav
mv audio_12.wav Rapsodie_Espagnole-12-Catacombae__Sepulchrum_Romanum.wav
mv audio_13.wav Rapsodie_Espagnole-13-Cum_mortuis_in_lingua_mortua.wav
mv audio_14.wav \
	Rapsodie_Espagnole-14-La_Cabane_de_Baba-Yaga_sur_des_Pattes_de_Poule.wav
mv audio_15.wav Rapsodie_Espagnole-15-La_Grande_Porte_de_Kiev.wav
mv audio_16.wav Rapsodie_Espagnole-16-Pavane_de_La_Belle_au_Bois_Bormant.wav
mv audio_17.wav Rapsodie_Espagnole-17-Petit_Poucet.wav
mv audio_18.wav Rapsodie_Espagnole-18-Laideronnette,_Impiratrice_des_Pagodes.wav
mv audio_19.wav Rapsodie_Espagnole-19-Les_Entretiens_de_la_Belle_et_la_Bjte.wav
mv audio_20.wav Rapsodie_Espagnole-20-Le_Jardin_Fierique.wav
mv audio_21.wav Rapsodie_Espagnole-21-Prilude_`_la_Nuit.wav
mv audio_22.wav Rapsodie_Espagnole-22-Malaguena.wav
mv audio_23.wav Rapsodie_Espagnole-23-Habanera.wav
mv audio_24.wav Rapsodie_Espagnole-24-Feria.wav

Execute permissions are not set for this script, so the simplest method to run it is with:

sh rename.sh

This script will fail for all but tracks 3 through 5, causing many error messages.

If you intend to immediately write out these WAV files to a CD-R, you may not want to run this script. tracknames.pl does not move the .inf files that are associated with each WAV file. The .inf files contain pre-gap information that can be used when writing the blank CD-R.

Future versions of the cdrecord distribution will most likely feature enhanced CDDB functionality. Support will most likely have changed by the time you have read this.

Burning an audio image to a CDR with cdrecord

A collection of WAV files (recorded at the proper frequency of 44.1 kHz with the proper attributes) can be burned to a blank CD-R with a call to cdrecord of the following form:

/opt/schily/bin/cdrecord -v speed=2 dev=0,0,0 -pad -useinfo -audio *.wav

You should probably test the recording by using the “-dummy” option before commiting to a write. The -useinfo option above will not work unless you have preserved the .inf files that were generated by cdda2wav. The -pad option above ensures that the audio tracks are padded to a multiple of 2352 bytes, as is required for storage on an audio CD.

A data track can also be included, in addition to the audio tracks, in a “mixed-mode” CD. The single data track is specified first:

/opt/schily/bin/cdrecord -v speed=2 dev=0,0,0 /tmp/cdimage.raw -pad -useinfo -audio *.wav