The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Burning CDs on an IDE CD-RW 23 May 2006
Need more help on this topic? Click here
This article has no comments
Show me similar articles

This article describes how I use cdrecord to burn CDs on my IDE CD-RW. I also have a SCSI CD-RW; cdrecord - writing your own CDs describe how I use the SCSI drive with cdrecord.

My thanks to Pav Lucistnik for his help in understanding the problem and working with me to get things running.

It was a holiday Monday in Ottawa, when it was decided that it was time to move the rack to the other side of the basement. The goal was to make more usable space. It difficult to get the rear of the rack, and to the shelves behind the rack. The idea was to swap the rack and the shelve, rotating both 90 degrees in the process. I knew I'd have to move some cables. When it was first suggested that I move the rack, it was about 1:00 pm. I said it'd probably take 5 hours to move it. I wasn't wrong. There's still a few things that need to be set up, but for the most part, the LAN is up and running and everything is in much better shape than it was before.

I took the opportunity to give each machine a thorough cleaning, getting rid of all the dust inside and on the fans and power supplies. It was then that I [re]discovered that one of my lesser used machines contained a CD-RW. I moved it from that machine to polo and removed the dead[?] DLT drive that had been sitting there unused since I started having trouble with it and moved to an external DLT drive.

How FreeBSD sees the drive

The machine named polo is my work horse. I do all my FreeBSD Diary, FreshPorts, FreshSource, BSDCan, etc, work on that computer. It is running FreeBSD 4.11 STABLE. That sounds old, now that FreeBSD 6.1 is out.

When I first booted up the box with the CD-RW in the system, I found this:

# dmesg | grep cd0
acd0: CD-RW <HL-DT-ST GCE-8523B> at ata1-slave PIO4

When I showed this to Pav, he said PIO can only push 4x speed, which makes it pretty slow. He said that using atacontrol I should be able to use UDMA33 instead.

Sure enough, the following command changed everything:

# atacontrol mode 1 slave UDMA2
Master = ???
Slave  = UDMA33
# atacontrol info 1
Master:      no device present
Slave:  acd0 <HL-DT-ST GCE-8523B/1.01> ATA/ATAPI rev 0
#

Pav said I should now be able to see the CD-RW as a SCSI device. I started searching:

# camcontrol rescan all
Re-scan of bus 0 was successful
Re-scan of bus 1 was successful
Re-scan of bus 2 was successful
Re-scan of bus 3 was successful
Re-scan of bus 4 was successful
# camcontrol devlist
<QUANTUM DLT7000 1E48>             at scbus0 target 8 lun 0 (pass0,sa0)
<ADAPTEC RAID-5 3A0L>              at scbus1 target 0 lun 0 (pass1,da0)
$

Nothing. Nothing at all. What about cdrecord?

# cdrecord -scanbus
Cdrecord-Clone 2.01 (i386-unknown-freebsd4.10) Copyright (C) 1995-2004 Jörg Schilling
Using libscg version 'schily-0.8'.
scsibus0:
        0,0,0     0) *
        0,1,0     1) *
        0,2,0     2) *
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *
        0,8,0     8) 'QUANTUM ' 'DLT7000         ' '1E48' Removable Tape
scsibus1:
        1,0,0   100) 'ADAPTEC ' 'RAID-5          ' '3A0L' Disk
        1,1,0   101) *
        1,2,0   102) *
        1,3,0   103) *
        1,4,0   104) *
        1,5,0   105) *
        1,6,0   106) *
        1,7,0   107) *
#

Still nothing. After I reported this back to Pav, he asked me if I had atapicam in my kernel. I did not. So I added this to my kernel config and build a new kernel:

# so I can access my CD-RW as a SCSI device.
device          atapicam        # emulate ATAPI devices as SCSI ditto via CAM

Then I built a new kernel and installed it.

The new kernel

After reboot, I found this new device:

cd0 at ata1 bus 0 target 1 lun 0
cd0: <HL-DT-ST CD-RW GCE-8523B 1.01> Removable CD-ROM SCSI-0 device
cd0: 16.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed

WOO HOO!

Of course, the old device was still there.

acd0: CD-RW <HL-DT-ST GCE-8523B> at ata1-slave PIO4

camcontrol also knew about the drive:

# camcontrol devlist
<QUANTUM DLT7000 1E48>             at scbus0 target 8 lun 0 (pass0,sa0)
<ADAPTEC RAID-5 3A0L>              at scbus1 target 0 lun 0 (pass1,da0)
<HL-DT-ST CD-RW GCE-8523B 1.01>    at scbus6 target 1 lun 0 (pass2,cd0)

From the above, you can see that the CD-RW will be device 6,1,0. That will be used when it comes time to burn the CD.

Setting atapi at boot time

Pav also mentioned I'd need set this in /boot/loader.conf:

hw.ata.atapi_dma=1

NOTE: In Feb 2007, I was setting up a new development machine, and instead of compiling a new kernel, I added this to /boot/loader.conf, in addition to the above mentioned setting:

atapicam_load="YES"
After a reboot, that gives me this:
acd0: CD-RW <HL-DT-ST GCE-8523B> at ata1-slave UDMA33

cd0 at ata1 bus 0 target 1 lun 0
cd0: <HL-DT-ST CD-RW GCE-8523B 1.01> Removable CD-ROM SCSI-0 device
cd0: 33.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed

Note the higher speed of 33MB/s versus 16MB/s as shown previously.

Burn Proof

Pav also mentioned burn proof. Various drives support Buffer Underrun Free technology. The cdrecord man page details this.

cdrecord can report upon the drive's capabilities:

# cdrecord dev=6,1,0 -checkdrive
Cdrecord-Clone 2.01 (i386-unknown-freebsd4.10) Copyright (C) 1995-2004 Jörg Schilling
scsidev: '6,1,0'
scsibus: 6 target: 1 lun: 0
Using libscg version 'schily-0.8'.
Device type    : Removable CD-ROM
Version        : 0
Response Format: 2
Capabilities   :
Vendor_info    : 'HL-DT-ST'
Identifikation : 'CD-RW GCE-8523B '
Revision       : '1.01'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-2 SWABAUDIO BURNFREE
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R

I have highlighted the BURNFREE in bold. The drive supports it, so I'll add it to the command line.

The burn!

The first burn was with this command:

# cdrecord speed=52 dev=6,1,0 driveropts=burnfree 6.1-RELEASE-i386-disc1.iso
cdrecord: No write mode specified.
cdrecord: Assuming -tao mode.
cdrecord: Future versions of cdrecord may have different drive dependent defaults.
cdrecord: Continuing in 5 seconds...
Cdrecord-Clone 2.01 (i386-unknown-freebsd4.10) Copyright (C) 1995-2004 Jörg Schilling
scsidev: '6,1,0'
scsibus: 6 target: 1 lun: 0
Using libscg version 'schily-0.8'.
Device type    : Removable CD-ROM
Version        : 0
Response Format: 2
Capabilities   :
Vendor_info    : 'HL-DT-ST'
Identifikation : 'CD-RW GCE-8523B '
Revision       : '1.01'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-2 SWABAUDIO BURNFREE
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
Starting to write CD/DVD at speed 52 in real TAO mode for single session.
Last chance to quit, starting real write    0 seconds. Operation starts.
Turning BURN-Free on
Track 01: Total bytes read/written: 529784832/529784832 (258684 sectors).

That was very fast! You'll notice that I used speed=52. The drive has 52x24x52x written on the front of it. Hence, the writing at 52x.

I took that CD and booted from it using another system. Up came the FreeBSD 6.1 install, no problems! This is good! Now I have two CD-RW drive I can use.

Closing thoughts

I bought my first CD-RW back in October 2000, I was advised to buy SCSI because IDE could often not keep up with the burn process. Obviously, things have changed since then. Not only are IDE CD-RW cheaper, they appear to work just fine.


Need more help on this topic? Click here
This article has no comments
Show me similar articles