[Information Coding Laboratory]

CD Writer Information

Description

The lab cdwriter is currently located on meltdown (although this may change soon) and is capable of writing both CD-R (write-once) media and CD-RW (re-writeable) media. The hostname of the machine with the cdwriter is set in the common login in the environment variable CDR_HOST, so check this variable and/or the lab map if you are uncertain of its current location.

Currently the CD-R media is much cheaper by at least a factor of 10 than the CD-RW media. Also keep in mind that most old CD-ROM drives CD audio players CANNOT read the CD-RW media, but they should be able to read the CD-R media. Both types of media can hold up to 650 Mbytes or 74 minutes of audio.

This document may not cover everything you would like to know regarding CD-R/CD-RW so I listed a few links below as starting points when searching for other information:

  1. CD-R FAQ
  2. Linux CD-Writing HOWTO

Instructions for Use

The description in this section currently only describes the process of creating data CDs. In the future more information on audio CDs may be added. The main differences will be in the creation of the CD image file not in the actual writing step. Also much of the description is geared towards creating iso9660 filesystems. It is possible to create CDs with other filesystems, but they will not be as portable across different operating systems.

The process of writing a CD can be broken down into the following list of steps:

  1. Collect files you would like on the CD.
  2. Create an image file.
  3. Verify that the image file is correct.
  4. Burn the CD.
  5. Check for any errors.

Collect the files

In this step, you should figure out which files you like on the disk and how you want the directories laid out on the CD. Note that you don't need to actually copy files under a single directory - just create a list of directories you would like on the CD since the program that creates the image file can take a list of pathnames to include.

Create an image file

The image file will be a complete bit-for-bit image of the data that will be written to the CD. Therefore this file can take up a great deal of space (up to 650 MBytes). The reason for first creating the image file is because the writing process is rather timing critical so you want to minimize the risk that the data isn't ready when the cdwriter needs it. If the cdwriter buffer underflows at any time during the writing process, then your CD-R disk is probably useless (unless you need a frisbee). Also once you have created the image file you can mount it like an actual CD and make sure you have all the files you want and that you are satisfied with the directory layout, etc. For the timing reasons mentioned above as well as disk space considerations, the image files should be written to the local disk of the cdwriter host machine (CDR_HOST). To make this step easier, an automount point has been created on all the lab machines at
/cdimage
to point to a staging directory on CDR_HOST. Please write your image files to this directory.

Since we have a fairly limited amount of disk space available for holding CD image files, please delete your image files as soon as possible so others will have space to create their files. I realize that verifying a CD against the image file can be time consuming and may require an overnight run. However, in any case, please delete your image files within 48 hours. Any files older the 48 hours in the /cdimage directory are subject to automatic removal.

The mkisofs is used to create the image file. Among other things, this program takes care of mapping filenames into the DOS style 8.3 names. This can turn many of your long filenames into something considerably less meaningful. The joys of DOS compatibility! Don't fear though, there is a way for your more capable operating systems to see the long filenames - rock ridge extensions. You probably almost always want to use the rock ridge extensions so don't forget that option ('-r'). Also you probably want it to create a TRANS.TBL file in each directory which is a text file showing the mapping between the short filenames and the original long ones (option '-T'). This file is useful if you want to read the CD under DOS and need to figure out the truncated name of one your long filenames.

An example of the command to create the image file is:

mkisofs -T -r -o /cdimage/cd_image_file original_dir
See the man page on mkisofs for a full list of command line options - they are too numerous to list here.

Note: I've had some trouble with the version of mkisofs on the linux machines dumping core when building large image files. The version on the Suns seems to work though, so try running it on blast or plague if you have trouble.

Note 2: When creating cdimages of several sub-directories, I found the following problem. Assuming the dir structure

~/thisdir/subdir_1
~/thisdir/subdir_2
~/thisdir/subdir_3
If you try to make a cdimage of just subdir_1 and subdir_2, you need to run
mkisofs -T -r -x ~/thisdir/subdir_3 -o /cdimage/cd_image_file ~/this_dir
But it appears that if you add the '/' to the end of subdir_3, that exclusion may not work. I hope this helps people in the future.

Verify the image file

Now you can mount the image file as if it were the actual CD and make sure everything looks correct. You should probably do this on the CDR_HOST since it will definitely have support for mounting the file - other machines in the lab may not. To mount the CD run:
mount_cdimage cdimage_filename
Now your image file should be accessible at /mnt/cdimage. Once you are done AND BEFORE DELETING OR WRITING OVER THE FILE, unmount the image file by running:
umount_cdimage

Burn the CD

Now you're ready to actually burn the CD. Place the media in the cdwriter. If the drive immediately ejects the disk, then you probably inserted it upside down - flip the disk over and try again.

The actual writing is done with a program called cdrecord , so check the man page on this program for command line options. However, to make things easier and to prevent possible problems, you will need to run the program icl_cdrecord which calls cdrecord after setting some options for our setup. It takes care of the device setting so you won't need to worry about this one (in fact it won't allow you to set this via the command line). Also the default speed is set at 4. You can override this value with the speed=# command line option. You may want to override the speed on the command line with a smaller value (1 or 2) if you have problems at 4.

To do a practice run without actually writing to the disk, issue the following command:

icl_cdrecord -v -dummy cdimage_filename
This does everything except actually burn the data (i.e., goes through all the motions but the laser is turned off). This is useful to check if there are timing problems on the system.

After doing a test run, the eject button on the CD Writer does not work. If you want to eject your CD for some reason at this point, you can run the command:

icl_cdrecord -eject
You can use this command at any time to eject the CD from the CD Writer.

Now to really write the data simply remove the dummy option above:

icl_cdrecord -v cdimage_filename
It will take about 74 minutes to burn a complete CD at single speed, so with a speed value of 4, the complete CD will require about 18-19 minutes.

Check for any errors

Now that you're done writing, you can remount the image file as well as the new CD and do one-to-one comparison to check for any errors. This process can take a long time, so I would suggest moving the CD to the internal CD-ROM drive on the CDR_HOST since it is faster. Next mount the CD (usually with a command like mount /mnt/cdrom) and mount the image file as previously described. The following command will compare each file and only print the names of those that differ:
diff -q -r /mnt/cdrom /mnt/cdimage
Don't forget to unmount everything when you're done and delete the image file so there's room for the next person.

Finally, if you want to label the CD itelf, you can use one of the special CD pens available in the lab. Also there is a LaTeX style file /icl-tools/tex/latex/cd-cover.sty to help create covers for the CD jewel case. See the documentation in /icl-tools/tex/latex/cd-cover.dvi


Welcome · Projects · People · Papers · Calendar · Links · Internal
© 1998 Information Coding Laboratory
Send comments to www@code.ucsd.edu

Last modified: Sat Jan 16 08:25:30 PST