This tutorial is about burning CDs on FreeBSD from the command line.
If you are as lazy as me, then try the tiny CD and DVD creation tutorial which uses the excellent K3B GUI to create a CD or DVD.
All the commands below assume that devices are defined as follows:
For FreeBSD 5.x, 6.x:
CD-RW: /dev/acd0
CD-ROM: /dev/acd1
For FreeBSD 4.x, use the following devices instead:
CD-RW: /dev/acd0c
CD-ROM: /dev/acd1c
Data CDs:
The most common commands for data CDs:
Burn a data CD from an ISO image file (man burncd for details):
burncd -f /dev/acd0 -s 4 -e data cd-image-file.iso fixate
Read the contents from a data CD to an ISO image file:
dd if=/dev/acd1 of=cd-image-file.iso bs=2048
Create an ISO image file from a directory:
(This requires mkisofs, the port was in /usr/ports/sysutils/mkisofs, now mkisofs is included in the port /usr/ports/sysutils/cdrtools.):
The above command creates an image with both Joliet and Rock Ridge extensions.
See the cdrtools port for details (mkisofs was a port of its own, now intergrated into cdrtools.
I have a DVD player with the options to read data CDs containing MP3 files, but some files couldn't be read with the Joliet extensions.
If you experience the same problems, try without the Joliet extensions:
Audio CDs:
Audio CDs require a bit more attention.
Each audio track is accessed as a device.
If not already done, the devices have to be created (applies to FreeBSD 4.x only).
Example how to create devices for ATAPI CDROM drives:
# cd /dev
# sh MAKEDEV ac0t99
# sh MAKEDEV ac1t99
The most common commands for audio CDs:
Read each audio track from an audio CD to WAV files...
... or read each audio track from an MP3 file using the XMMS standard plugin Disk Writer to convert them from MP3 files to WAV files...
... or convert them directly to RAW files:
NOTE: Changes 2003-11-11 in this page (thanks to Pieter de Boer):
To avoid a little 'tick' at the start of every song (the 'tick' is the .wav header), do NOT use the .wav files directly to burn your audio CD, convert them to .raw files first.
Read more about this issue (FreeBSD Handbook updates for 'burncd') at http://lists.freebsd.org/pipermail/freebsd-doc/2003-April/000278.html
.
You have two options to create the .raw files:
a. Use 'sox' (port in /usr/ports/audio/sox) to convert .wav to .raw: