All of the former “Grad Lab” machines (now located in various other places around the Department) are equipped with DVD/CD drives capable of recording CD-Rs and CD-RWs. How to accomplish such a magical feat? Read on….
Preparing the Files
A standard CD-ROM can hold approximately 650 MB of data. Many CD-Rs and CD-RWs these days are labelled as “80 minute” CDs; these can hold around 700 MB. Check the packaging of your disc(s) to determine the specific maximum capacity. Note that the file system itself will take up some space, so the usable capacity in practice will be slightly less than the advertised capacity.
The CD drives are capable of creating audio (non-data) CDs, as well as data discs; however, we only support the creation of data CDs at this time. See the man page for cdrecord(1) for details on creating an audio CD that can be played in a normal CD player. (See also the note section, below, on the use of copyrighted materials.)
Directory and file names will appear on the CD just as they appear on the current file system, so arrange the files as you would like them to appear on the CD (directory structure, exact names, etc.). Note that you will probably exceed your disk quota if you try to prepare a CD layout in your home directory; instead, use the /temp/your-username/ directory. (For example, if your login name is abc123, then you should use the directory /temp/abc123/.) Files stored in this location will be automatically deleted by the system after a set time (on the order of a few days), so don’t leave things there or try to use it as a general storage location!
Generating a CD Image File
Note: If you have downloaded a disk image (“ISO”) file, and you just want to burn it to CD, then you can skip this step. If you have a CD that you just want to copy bit-for-bit, see the section at the bottom of this page about copying CDs.
Once you have the files arranged as you want them, you must build a CD image file. This file is an exact binary replica of the data as it will appear on the CD. Because the CD recording program will need to have uninterrupted, relatively high-speed access to this file, you must create it on a locally mounted file system. (Places such as /temp/ or your home directory are mounted over the network and, while fast enough for regular uses, are too slow for CD burning purposes.) Use the /buffer/ directory for this purpose.
You will use the mkisofs(8) utility to create the disk image. There are a variety of command-line options available; see the man page for details. The most common command-line form that you will probably use is:
mkisofs -frvJL -o /buffer/mycd.iso /temp/mydirectory/
In this example, a disk image of all the files and directories under /temp/mydirectory/ would be compiled into a disk image file named /buffer/mycd.iso.
Writing to the CD
You must be logged in locally (physically at the terminal) in order to record a CD; logging in remotely (e.g., via SSH) will not work. Also, check to ensure that the machine is not under a heavy load (for example, someone running a CPU-intensive job): If the CD recording process does not get sufficient CPU time and disk access to keep its buffer full throughout the process, the CD will be ruined and the recording operation will fail. You can use the uptime(1), w(1), or top(1) commands to check the current users and load averages.
Once you are ready, insert your CD-R or CD-RW into the drive. Once you hear it spin up the disc, enter one of the following commands (depending on which disc type you are using):
For a CD-R: cdrecord -v speed=16 dev=2,0,0 /buffer/mycd.iso
For a CD-RW: cdrecord -v speed=4 dev=2,0,0 blank=fast /buffer/mycd.iso
Note that these commands assume a “16x capable” CD-R or a “4x capable” CD-RW. Most CD-R/RW media these days can be recorded at these speeds; but you should check first to be sure (especially if you are using older discs). To use a different speed, change the speed= option accordingly. If in doubt, you can always select speed=1 — it will be slow (taking about an hour per disc for a maximally sized disc image), but it will always work on any media.
Please be aware that recording a CD, even at higher speed= settings, can take a while, and if you log out or stop the recording before it is done, the CD will be ruined. Therefore, don’t start a recording session unless you know that you will be able to wait there at the computer for it to finish.
Post-Recording Cleanup
Once you have finished recording the CD, it is very important that you delete your CD image file. The /buffer/ partition is not very big, and if you leave your file(s) in there, other people will not be able to record CDs on that machine (and they will consequently become angry with you, and your login name is right there in the file ownership field…). Also, don’t forget to remove your CD! (People leave behind discs more often than you might think.)
Other Notes
To copy a CD, first insert the source CD, and then issue the following command:
dd if=/dev/cdrom of=/buffer/mycd.iso
Then simply follow the instructions for recording a CD image from that image file (given above).
Blank CD-Rs and CD-RWs can be purchased at the Co-Op and at the Campus Computer Store. They can also be purchased (often at much better prices) at any computer store in town. Even grocery stores and gas stations sell these things now. However, one place where you can not get them is from us; please don’t come by our office to try to bum some CDs off of us. Seriously.
Finally, please note that illegally copying copyrighted software, music, movies, or other materials is a serious crime that might result in extreme, possibly even inhumane punishments. Don’t do it (especially on our machines)!!