CD Writing Instructions Notes on making an image file ----------------------------- First, decide which files you want to write to the CD and about how much space they are going to take up. A CD holds about 650 MB, (700 MB for the 80 minute CDs that we have at the moment), but because of space needed for writing directory structure, the effective maximum is smaller. Next, pick which disk you are going to write your CD image to. The disks /mydisks/cd_c, /mydisks/cd_b, and /mydisks/cd_c on baker were setup for this purpose. If you are on baker, access these drives through /mydisks/cd_*, if you are on another machine you can access these disks through /net/baker/cd_*. Find out which one of these disk partitions nobody is using at this time. You will write your cd image on this open partition. Now you are ready to run mkisofs which will make a file that can be written to the CD. This process will take a 20 minutes if you are writing a 600 MB image. Here's a sample mkisofs command line. mkisofs -r -J -l -L -f -v -hide-joliet-trans-tbl -m '*.o' -m "core" -m "a.out" \ -x /home/crumley/tmp -V "CD_Name" -o /mydisks/cd_c/jpc.iso /home/crumley Let's go through the options from the end. "/home/crumley" tells which which directory is to be written to the CD. "/home/crumley" could have been replaced by ".", if mkisofs were run from the directory /home/crumley. * "-o /mydisks/cd_c/jpc.iso" tells mkisofs where to write the disk image. * "-x /home/crumley/tmp" - this directory is excluded from the image file. * "-m '*.o' " - files matching this pattern are excluded from the image. * "-v" - verbose, this makes mkisofs print to screen what files it is adding to the image. * "-f" - this means follow links. So files and directories that are links will be included. * "-l" and "-L" - these 2 options allow some types of filenames which MS-DOS might not like (32 chars and start with dots). * "-r" - Rockridge extensions, this allows unix styles filenames. * "-J" - Joliet extensions, for MS Windows * "-V 'CD_Name'" - the title you want to give to the CD. The CD will show up with this name when used in a computer. There are also other options, see mkisofs's manpage (type "man mkisofs") for details. Checking an image file ---------------------- If you want to check your image file before writing it to a CD, the file can be mounting as if it were a CD. You can then look through the image file's directory structure to see that it contains the files it is supposed to. The command line to mount the cd is given below. Currently you have to be root on baker to do this. And currently you have to be able to use sudo to become root. (This option is broken currently.) sudo mount -r -F fbk -o type=hsfs /dev/fbk0:/mydisks/cd_c/jpc.iso /mnt Then cd /mnt and look to see that everything you want is there. When you're done, unmount the image as root: sudo umount /mnt (Note: you can't be in the directory /mnt when you unmount the image). Writing an image file to CD --------------------------- Writing an image to a CD is an easier process than making the image. The first thing that you must do is find a blank CD and put it into the CD-R drive, which is currently attached to baker. Then you'll have to use the program cdrecord. You can run this command as a regular user. It takes about 20 minutes to write a ~600 MB CD. A sample command line is given below. To do this step you must be logged in to baker. (To test to see if CD will write correctly, but not actually write to CD add the "-dummy" option. This option is like a rehearsal for actually writing the CD. The entire process of writing a CD is gone through, except turning on the laser. So to actually write the CD, this option must not be present.) sudo cdrecord fs=10M -v dev=0,2,0 -pad -speed=4 /mydisks/cd_c/jpc.iso * "sudo" this option is necessary in order to get permission to write to the CD writer. You will be prompted for your password. Just type in your normal password. * "fs=10M" - this is the size of the memory buffer that cdrecord reserves while writing a CD. If you run into error messages about underflow, increase the value from 10M. * "-v" is verbose in this case as well, this will give you some idea of how much longer it will take to write the CD. * "dev=0,2,0" - this tells cdrecord where the CD-R is attached to the computer. This option should remain the same, unless the settings on baker are changed. * "-speed=4" - this sets the speed that the CD is written at. The maximum speed of our current drive is 4. * "-pad" - this option is needed as a work around for trouble writing certain (Fortran generated) binary files. You can probably get away without it if you don't have any files of this type in your image, but for safety's sake, you might as well put it in. * "/mydisks/cd_c/jpc.iso" - the name of the file image to be written to the CD. Running this command will write an entire CD that should be readable in normal CD-ROM drives. It is also possible to write to part of the CD, at one time and then add more to it later. When you write a CD this way, you can't read the CD in a normal CD-ROM drive until have "fixed" the CD. See the manpage for cdrecord for more details. Directly Copying CD-ROMs ------------------------ Directly copying CD's is fairly straightforward. Put the CD that you want to copy in baker's CD-ROM drive, and the blank CD in the CD-R drive. The command to make the CD is: sudo cdrecord -v -speed=4 -isosize dev=0,2,0 /vol/rdsk/NAME_OF_CD You'll probably have to do "ls /vol/rdsk/" to get the name of the CD. Copying Audio CDs ----------------- To copy an audio CD you should first copy the the audio tracks to a hard disk. (Be warned that audio data is stored differently than regular data. Each minute of audio takes up about 10 MB on disk, so if you have a CD that is longer about 65 minutes, all of the audio information will not fit into one of baker's /mydisks/cd_* partitions. You'll have to find somewhere else to store the audio files - preferably on baker. If you are clever, you can get around this problem by moving some of the tracks out of the way as they are created and then making symbolic links to them in the cd_* directory. Also, pay attention to the maximum size that it says for your CD-R media. If the package says 74 minutes, don't try to stuff 80 minutes of audio on the it. You'll just make a coaster if you do try it.) Currently, cdda2wav only works on the Sun boxes with SCSI CDROMs - (belka, ham, and gordo), not the newer machines (baker, pchelka, ...). To copy the audio data to disk, go to the directory where you want to put the audio data, and then type: sudo cdda2wav -B This command will copy the entire CD to the hard disk, a track at a time. The program will make several files, but the important files are the *.au files. These files contain the actual music. See the cdda2wav manpage if you want to find out about other options. You can check to make sure that they copy OK by using the audiotool program. Now to copy these files to a CD-R, first insert a CD-R in the CD-R drive. Then use a command such as: sudo cdrecord -v dev=0,2,0 -speed=4 -audio -pad audio_*.au The first few options are explained above. The "-audio" option tells cdrecord that you want to record audio files. The "-pad" means to pad any audio files that ado not have an even length with a small amount of blank data. And the "audio_*.au" tells cdrecord to add all files of the in the current directory starting with "audio_" and ending with ".au" to the CD-R. If you used cdda2wav as suggested above, the cdrecord command line given above should work as is. If not, you may have to make some alterations for different filenames, etc.