Get Firefox! Viewable with any browser! Valid HTML 4.01! Valid CSS!
Text size: 

CD Writing Howto


BSD Beastie

Before going any further, let it be known that I am not an expert in matters FreeBSD-related. I've only been using this O/S since mid October 2004, having migrated to it from Slackware Linux. Furthermore, the details on this page relate mostly to FreeBSD 5.x, so there may be differences between what's here and what goes on in your system if it's running FreeBSD 4.x.

Users of FreeBSD who have ATAPI devices will be pleased to know that there's a utility within the base system called "burncd". As usual, the FreeBSD Handbook provides excellent documentation: burncd page.

cdparanoia also works on FreeBSD (see ports: audio/cdparanoia) but there's a niftier way of grabbing audio tracks from a CDDA. Rather than detail everything here I'll direct you to a page written by a friend, Scott Robbins:

However, for all its merits, burncd only knows about TAO and DAO modes, so if you need to record audio tracks without gaps between them but your CD writer doesn't support DAO mode, then you have to use one of the alternative modes that cdrecord can use.

cdrecord itself is in ports (sysutils/cdrtools) so installing it shouldn't be a problem. That's the good news. The bad news is that the FreeBSD version doesn't know about the "dev=ATAPI:a,b,c" way of specifying the device you want to write to.

You therefore need to add the FreeBSD equivalent of IDE-SCSI emulation, ATAPICAM, to your kernel for cdrecord to be able to use your CD writer. If you're not familiar with the concept of compiling a FreeBSD kernel then read the page about it in the FreeBSD handbook.

The options you need to add to your kernel configuration (or at least make sure they're already there) are:

device    atapicam
device    scbus
device    cd
device    pass
device    ata

Once you've built and installed the new kernel and rebooted, you can check that the CD writer is recognised:

# camcontrol devlist
<SanDisk ImageMate III 2.31>       at scbus0 target 0 lun 0 (pass0,da0)
<IDE-CD R/RW 12x8x32 3.0>          at scbus2 target 0 lun 0 (cd0,pass1)
<SAMSUNG DVD-ROM SD-616Q F401>     at scbus2 target 1 lun 0 (cd1,pass2)

The CD writer is picked up and connected to SCSI bus 2, target 0, LUN 0, meaning that cdrecord will be able to address it as dev=2,0,0.

Also note that from this point onwards, your CD writer is no longer seen as /dev/acd0 or /dev/acd1, but as /dev/cd0 or /dev/cd1 now. Don't forget to update your /etc/fstab file and any /dev/cdrom or /dev/dvd symlinks to reflect the change.

You can still "preview" an ISO 9660 image before burning it to a CD by using FreeBSD's Memory Device interface. First you associate the file containing the ISO image with a memory device. If you know full well that, for example, /dev/md0 is not in use, you can tell the system that you want that one explicitly:

# mdconfig -a -t vnode -f filename.iso -u 0

The "-u 0" here is saying that we want to use memory device /dev/md0. Alternatively, you can let the system determine which memory device to use and inform you of the choice made:

# mdconfig -a -t vnode -f filename.iso

The system chose /dev/md0 here anyway.

The next step is to mount this memory device as we would a CD-ROM:

# mount -t cd9660 /dev/md0 /cdrom

From here onwards you can cd into /cdrom and examine the structure of the future CD-ROM.

In order to unmount the CD-ROM image you proceed as usual:

# umount /cdrom

Next, you detach the memory device from the file containing the ISO image. Assuming the file was attached to memory device 0 (/dev/md0):

# mdconfig -d -u 0


<< 11) Mixing audio and data on a CD 13) Blanking a CD-RW >>

Back to the howto title page
Back to