Red Antigua Logo
Yet another piece of web.
Ads by Goooooogle
Search this site (by Google)
Tools    (top)
Your IP
Check a site for broken links
(W3C)

Perl modules    (top)
Tree::Numbered::Tools
(CPAN)
Perl tutorials    (top)
Perl modules
HTML::Template
CGI::Application
Mail::POP3Client
Mail::Send
MIME::Tools
Cookies with CGI::Application
Upload files with CGI::Application
Download files with CGI::Application
Redirect with CGI::Application
CPAN shell
Install DBD::mysql from the CPAN shell
Perl trim function
Validate an IP with Perl
Run suid Perl scripts under Apache
Perl taint mode
Perl date functions with Date::Calc

In Spanish
Curso de Perl

C tutorials    (top)
C - Introduction
C - Absolute beginner's Emacs
C - Examples for beginners
C - Makefile examples
C - Autotools examples
Server configurations    (top)
DNS
Apache
Apache Authentication and Access Control
mod_perl on FreeBSD
MySQL
MySQL add account
phpMyAdmin
Squid
DHCP

UNIX on Windows    (top)
Apache setup on Windows
MySQL setup on Windows
PHP setup on Windows
Perl setup on Windows
Emacs setup on Windows
UnxUtils
PuTTY
WinSCP
GIMP on Windows
MinGW - gcc on Windows
MSYS - UNIX-styled shell on Windows
msysDTK - autotools on Windows
GDB for MinGW on Windows

Misc. FreeBSD/UNIX    (top)
CD and DVD creation on FreeBSD using 'k3b' on FreeBSD
'portupgrade' on FreeBSD
'ipf' on FreeBSD
'pf' on FreeBSD
'su' on FreeBSD
Mount an ISO image under FreeBSD
Load the correct sound driver under FreeBSD without knowing what sound card you are using
Simultaneous sound channels on FreeBSD
FreeBSD network stuff
DOS-to-UNIX file conversion
favicon.ico on UNIX
Emacs tips
Sendmail tips
GKrellm
Command Line Calculator
Save multimedia streams with 'mplayer'
xargs - solution to 'Argument list too long'
Process multiple images from the command line using 'ImageMagick'
Turn the system bell off under X Windows
Process each line in an input file from the command line (or in a shell script)
How to keep a program running in the background using 'nohup'
How to remove symbolic links in the current directory using 'find' and 'rm'
How to remove Emacs backup files in the current directory and all subdirectories using 'find' and 'rm'
How to execute .profile without logging in
Configure X to handle non-English characters
How to move /var to /usr/var

Redirect a web page    (top)
Redirect to another web page
Apache redirect
C redirect
Perl redirect
PHP redirect
HTML redirect
JavaScript redirect

Javascript    (top)
Trim function
Login form
Register form
Popup window

Virus list    (top)
Latest 10 viruses - Sophos

Off topic    (top)
Personal home links

FreeBSD 'burncd' command
FreeBSD 'burncd' command        
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.):
    mkisofs -o cd-image-file.iso -J -R /path/to/directory
    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:
    mkisofs -o cd-image-file.iso -R /path/to/directory

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...

    FreeBSD 4.x:
    dd if=/dev/acd1t1 of=track1.wav bs=2352
    dd if=/dev/acd1t2 of=track2.wav bs=2352
    dd if=/dev/acd1t3 of=track3.wav bs=2352
    .
    .
    .
    FreeBSD 5.x:
    dd if=/dev/acd1t01 of=track1.wav bs=2352
    dd if=/dev/acd1t02 of=track2.wav bs=2352
    dd if=/dev/acd1t03 of=track3.wav bs=2352
    .
    .
    .
  • ... or use a small script if you are lazy like me (for FreeBSD 4.x) ...
    #!/bin/sh
    # Change device to acd1 if needed
    cdrom=acd0
    track=1
    finished=0
    while [ $finished = 0 ]; do
      echo "Reading track $track..."
      trackdevice=$cdrom't'$track
      filename='track'$track'.wav'
      command="dd if=/dev/$trackdevice of=$filename bs=2352"
      $command
      finished=$?
      track=`expr $track + 1`
    done
    
  • ... or use 'cdda2wav' from the port /usr/ports/sysutils/cdrtools to rip each CD track:
    cdda2wav -D /dev/acd0 -t 1
    lame -h -b 128 audio.wav track1.mp3
    cdda2wav -D /dev/acd0 -t 2
    lame -h -b 128 audio.wav track2.mp3
    cdda2wav -D /dev/acd0 -t 3
    lame -h -b 128 audio.wav track3.mp3
    .
    .
    .
    
  • ... 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:
      sox -V -t wav -r 44100 -w -s -c 2 track1.wav track1.raw
      sox -V -t wav -r 44100 -w -s -c 2 track2.wav track2.raw
      sox -V -t wav -r 44100 -w -s -c 2 track3.wav track3.raw
      .
      .
      .				
      
    • b. Use 'mpg321' (port in /usr/ports/audio/mpg321) to convert .mp3 to .raw:
      mpg321 --stdout sometrack.mp3 >track1.raw
      mpg321 --stdout anothertrack.mp3 >track2.raw
      .
      .
      .
      
    • ... and finally burn all raw audio tracks to a CD:
    burncd -f /dev/acd0 audio track1.raw track2.raw track3.raw ... fixate

To blank a CD-RW ("quick format", fast):
  • burncd -f /dev/acd0 blank
To erase a CD-RW ("full format", slow):
  • burncd -f /dev/acd0 erase
Read more at:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/creating-cds.html.
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sound-mp3.html.

Last modified: Fri Nov 30 09:55:37 Romance Standard Time 2007