Using the department's CD burner

1. Burning (HFS) MacOS CDs, audio CDs, or other formats:
Use the Toast software on MacOS to master your disc. The Toast CD and manual travel with the burner setup. Always put your staging data on the Jaz drive, rather than an internal drive, as the Jaz has no periodic "thermal recalibration" delay which can interrupt a burning session and destroy the CD.

2. Burning "Unix" CDs:
If you don't know what machine your CD will be read on (i.e. it's for archival purposes), and you're archiving Unix data, you probably want to create a Rock Ridge CD. See below.


Mastering a CD image of a Unix filesystem with mkisofs

ISO9660 is a standard, very simple CD filesystem format. Rock Ridge extends ISO9660 to allow long filenames, Unix file permissions, Unix softlinks, and deep directory trees. Mounting a Rock Ridge CD under most Unices looks just like the original filesystem. The data can still be read by ISO9660-only systems, too, but it's much uglier. This is the perfect filesystem if you (say) have a huge home directory that you'd like to archive before you delete a bunch of stuff to free up online disk space.

Rock Ridge cannot handle device special files or sockets, and probably cannot boot most machines. (For example, you might be able to write a Sun ufs CD that would be bootable. That would mean using a ufs filesystem, not Rock Ridge.)

The easiest basic process is to create a CD "image" file (a raw ~650MB file) on the Unix machine containing the source files, transfer that image to a Mac, and use Toast to burn it directly onto a CD using the Disc Image command. (Toast can even Mount the image on the MacOS desktop, so you can see how the disc would look if inserted into a Mac. The Mac I tried only understood ISO9660, so it was ugly.)

To create the CD image file, use the mkisofs command. mkisofs is a simple, portable program that traverses a Unix directory and writes out a Rock Ridge image file. I'll try to remember to install it in /usr/contrib/bin, but if I forgot or you're on a machine that's not part of the department NFS group, you can grab it from:

ftp://ftp.cdrom.com/pub/linux/tsx-11/packages/mkisofs/mkisofs-1.11.1.tar.gz
It should compile right out of the box. If all you need to do is copy a directoryfull onto a CD, use one of these two command formats:
mkisofs -a -R -T -v -o /usr/zealand2/jonh/cd.image .
mkisofs -a -r -T -v -o /usr/zealand2/jonh/cd.image .
The options are as follows:

-a Include all files, even those containing ~ or # in the filename.

-R Use Rock Ridge extensions to ISO9660 to record more of the Unix file information. This preserves all file permissions and owner information, which makes sense for an archival disc that you expect to be using yourself.

-r Use Rock Ridge extensions, but make all file owners 0 and use canonical file permissions. This makes a disc that can be read once mounted by any user on a system, and makes more sense for discs that you'll distribute or give to others.

-T Generate a file TRANS.TBL in each directory that describes how long filenames are mapped to ISO9660 8.3 filenames. Use this if you think the disc might be read on an ISO9660-only system, so you can figure out what files started out as. Omit it if you know the disc will be used only on Rock Ridge machines and you want to avoid cluttering the directories.

-v Be verbose.

-o filename Where to write the output CD image. This should probably not be in the same directory as the source files, or you might get a little recursion going. Make sure the destination directory has enough space for the image. You can see how much space a source directory will consume, in K, with

du -s -k .
You can see how much space a destination directory has free with
df -k /destination/dir

. This is the directory you're archiving. If .mkisofsrc (see below) is at the top of the source tree, you should cd there and use . as the source directory name, so mkisofs sees the .mkisofsrc file.

You might also put a .mkisofsrc file in the top directory of your source tree, with something like this in it:

APPI=Partial backup of jonh's home directory, disc 1/2
COPY=Copyright 1997 Jon Howell
PREP=Jon Howell P.O. Box 412 Meriden, NH  03770-0412  603-HOWELL-6 6211 Sudikoff Lab Hanover NH  03755-3510  603-646-3297
VOLI=jonh2of2
Maybe the most interesting line is "VOLI", which is the volume name the disc shows when mounted on a Mac (and probably other machines).

There are lots of other options to mkisofs, and other things you can put in .mkisofsrc. Read the manual page if you want to do more than the basics described above.


Burning the disc from MacOS with Toast

When you've created the CD image file with mkisofs, Fetch (FTP) it to the Jaz drive on a Mac. (At 100k/s, this can be the slowest part of the operation.) Make sure you use binary mode. Open Toast, select Disc Image from the Format menu, click the Data... button to select the disc image from the Jaz drive. [Click Mount now if you want to make sure the disc image looks "right".] When you're ready, click Write CD..., and off you go. I recommend letting Toast verify the CD when it's done.

If you need just one or two CD-Rs, ask me (jonh), I might have a couple floating around that I'll sell.


Burning the disc from Unix with cdrecord

  1. The CD-Writing HOWTO: http://secretagent.com/doc/howto/CD-Writing-HOWTO.html
  2. Get and build cdrecord from: ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/cdrecord.tar.gz or ftp://sunsite.unc.edu/pub/Linux/utils/disk-management/cdrecord-1.6.tar.gz
  3. You'll need a Unix box with a SCSI port.
  4. If you're booting Linux, you'll want to make sure the Jaz drive is numbered higher than your boot disk, because of Linux's stupid sequential device naming policy.
  5. On modern Linuxes, you should already have the generic SCSI devices /dev/sg?. cat /proc/devices and look for "sg". On other Unices, you may have to build and install the kernel module. I think it comes with cdrecord.
  6. On non-intel linuxes, you'll probably have to increase SHMMAX in /usr/include/asm/shmparam.h. On Linux/PPC, I changed it from 0x3fa000 (4MB) to 0xffa000 (16MB). Rebuild and install a kernel with that change. (Linux/i386 seems to come with a large SHMMAX by default.)
  7. Mount the Jaz disk filesystem. On my linux-ppc box, I leave it formatted as MacOS, and do:
    mount /dev/sdc4 /mnt/macos
    
  8. FTP your image file to the Jaz disk.
  9. The HOWTO above tells how to test-mount the CD image using the loopback device in Linux, if you wish to verify it.
  10. Find the CD writer's SCSI ID:
    ./cdrecord -scanbus
    
  11. Try a dummy burn to see if your machine can keep the burner buffer full. In the example below, "4,0" means SCSI ID 4 (from the -scanbus test), LUN 0 (always). Our writer writes at speed=2 (2x).
    ./cdrecord speed=2 -v -dummy -eject -dev=4,0 /mnt/macos/cd2.image
    
    In my experience, the fifo can get all the way to 0% and you can get multiple "fifo empty" conditions with no problem, as long as you don't get an underrun error. I don't know why it doesn't keep the fifo fuller, but it didn't seem to hurt my CD. Also, the -eject after the dummy record is necessary; apparently our brand of CD writer gets confused if you don't. I also noticed that if you interrupt the dummy write, you'll have to power cycle the whole contraption before the CD writer will respond again.
  12. If it doesn't complain, burn the disk.
    ./cdrecord speed=2 -v -eject -dev=4,0 /mnt/macos/cd2.image
    
  13. Re-insert the disc, and verify it:
    dd if=/dev/scd1 bs=512 | cmp - /mnt/macos/cd2.image
    
    You'll get an I/O error at the end of the dd read, but I think that's okay. Note I used /dev/scd1 above; that's because my system already had another CD-ROM drive allocated to /dev/scd0.
  14. I like to make a catalog of the CD I can keep online and grep to see which CD my file is on:
    mount /dev/scd1 /mnt/cdrom
    cd /mnt/cdrom
    find . > /tmp/cd2.catalog
    

    This is http://www.cs.dartmouth.edu/~jonh/cdburner.html