CD-Writing HOWTO V1.4


Index
0.0 Changes
1.0 Introduction
2.0 Creating an ISO file
3.0 Writing the CDROM
3.1 Writing a CDRW
3.2 Blanking a CDRW
4.0 Verifying the CDROM
5.0 Problems

0.0 Changes

1.0 Introduction

The CD-WRITER has been moved and now lives on SXT4. All writing operations must be carried out on SXT4. There are 3 processes involved in writing a CDROM. These processes are discussed in detail below. This recipe should work 95% of the time. It is likely that there will be a 5% failure rate in writing CDROMs. This is not that unusual. Section 5.0 covers some problems you may encounter.

2.0 Creating an ISO file

As described above, an ISO file is an image that is created from the files you want to appear on the CDROM. A CDROM can hold approximately 650 Mb, so the ISO file should be no larger than this. The command mkisofs is used to create an ISO file suitable for writing to a CDROM. Do a man mkisofs for more information on the command itself. However, a handy script has been created to save you some work. The script is called /usr/local/bin/mkiso.sh. It should be in your path by default. This script sets many of the options you will need to create an ISO file properly. Type
mkiso.sh
for options used with the program. The first stage in constructing an ISO file is to decide on how you want your data to appear on the CD. The way this is generally done is to collect together all files (and directories) you want to put on the CDROM, together in one directory. Once this is done you should use mkiso.sh to create your ISO file in the following manner.
mkiso.sh VolumeName Directory
where the arguments are firstly the volume name you want for the CDROM and secondly the directory under which are all the the files you want put on the CDROM. The output ISO filename defaults to cdrom.iso in the current directory. An example of this is given below.
sxt4:~> ls -lR /home/ard/cdrom
/home/ard/cdrom:
total 3
-rw-r--r--   1 ard      solargp        23 Sep  7 14:01 README
drwxr-xr-x   2 ard      solargp       512 Sep  7 14:02 data1
drwxr-xr-x   2 ard      solargp       512 Sep  7 14:02 data2

/home/ard/cdrom/data1:
total 1
-rw-r--r--   1 ard      solargp       117 Sep  7 14:02 data1.dat

/home/ard/cdrom/data2:
total 1
-rw-r--r--   1 ard      solargp       143 Sep  7 14:02 data2.dat
These are the files and directories I want on my CDROM.
sxt4:~> mkiso.sh Volume_1 /home/ard/cdrom
mkisofs v1.11
  24   836 cdrom
  25   452 data1
  26   452 data2
Cache hit for cdrom/..
28 58 /home/ard/cdrom/cdrom.iso
59 59 /home/ard/cdrom/README
60 60 /home/ard/cdrom/TRANS.TBL
Cache hit for data1/.
Cache hit for data1/..
61 61 /home/ard/cdrom/data1/data1.dat
62 62 /home/ard/cdrom/data1/TRANS.TBL
Cache hit for data2/.
Cache hit for data2/..
63 63 /home/ard/cdrom/data2/data2.dat
64 64 /home/ard/cdrom/data2/TRANS.TBL
Total extents scheduled to be written = 65
Total extents actually written = 65
Total translation table size: 271
Total rockridge attributes bytes: 1155
Total directory bytes: 4096
Path table size(bytes): 38
65 extents written (0 Mb)
sxt4:~> ls -l /home/ard/cdrom.iso
-rw-r--r--   1 ard    solargp     63488 Sep  7 15:30 /home/ard/cdrom/cdrom.iso
The file cdrom.iso is now ready for writing to CDROM.

3.0 Writing the CDROM

When writing a CDROM, it is very important that the process can the read the ISO file at the rate needed. What this means in practice is that the ISO file needs to be on a local disk on SXT4. The local disk to use on SXT4 is /disk/sxt4. User directories are created here for you to copy across your ISO files. If you do not have one, please mail Keiji. Please make sure you delete your iso files when you are finished. Once you have your ISO file on SXT4, the next step is to verify the state of the CD writer. The command cdrecord is used, both to write the ISO file to CDROM and to perform status checks. Issue the following commands. The output should be identical.

cdrecord -scanbus
Cdrecord release 1.8a29 Copyright (C) 1995-1999 Jörg Schilling
Using libscg version 'schily-0.1'
scsibus0:
                  0) 'QUANTUM ' 'VIKING II 4.5WLS' '5520' Disk
                  1) *
                  2) *
                  3) *
                  4) 'HP      ' 'CD-Writer+ 9200 ' '1.0e' Removable CD-ROM
                  5) 'HP      ' 'C1537A          ' 'L610' Removable Tape
                  6) *
                  7) *
scsibus1:
                100) 'MegaRAID' 'LD0 RAID5 46666R' 'EC9F' Disk
                101) *
                102) *
                103) *
                104) *
                105) *
                106) *
                107) *
This shows us that the HP CD writer is known to the system, which is what we need and is known as dev=0,4,0. A further probe,
sxt4:~> cdrecord -inq dev=0,4,0
Cdrecord release 1.8a29 Copyright (C) 1995-1999 Jörg Schilling
scsidev: '0,4,0'
scsibus: 0 target: 4 lun: 0
Using libscg version 'schily-0.1'
Device type    : Removable CD-ROM
Version        : 4
Response Format: 2
Capabilities   : SYNC 
Vendor_info    : 'HP      '
Identifikation : 'CD-Writer+ 9200 '
Revision       : '1.0e'
Device seems to be: Generic mmc CD-RW.
and we see everything seems ok. It We are almost ready to start. Type the following command:
sxt4:~> cdrecord -eject dev=0,4,0
This will eject the CDROM. Take a blank CDROM from the draw marked "CDROMS" underneath SXT4. They are contained in the white "flower pot" marked "Kodak WRITABLECD" or the clear "flower pot" marked "Nashua". Be careful not to touch the shiny gold/green or sliver/blue side. Place the CDROM, matt-side up in the CD writer caddy and press the blue button. The caddy will close and the green "DISC IN" light will flash and then come permanently on. You are ready to write the CD. Issue the following command, [Note normal cd's can now be written at speed=8 - rewriteables at speed=4 - speed=8 translates to about 9 minutes to write a 700Mb cd.]
sxt4:~> cdrecord dev=0,4,0 speed=8 cdrom.iso
Cdrecord release 1.6 Copyright (C) 1995-1998 Jörg Schilling
scsidev: '0,4,0'
scsibus: 0 target: 4 lun: 0
Device type    : Removable CD-ROM
Version        : 4
Response Format: 2
Capabilities   : SYNC 
Vendor_info    : 'HP      '
Identifikation : 'CD-Writer+ 9200 '
Revision       : '1.0e'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
Driver flags   : SWABAUDIO
Starting to write CD at speed 8 for single session.
Last chance to quit, starting write in 1 seconds.
Track 01: Total bytes read/written: 133120/614400 (300 sectors).
and you should see output starting like above. Where it says "Last chance to quit, starting write in [n] seconds", the system will count down from 10 to give you a chance to abort the write process. While the CDROM is being written, you will see the green "WRITING" light flash. When the process is finished the light will go off. Hopefully you have a perfectly written CDROM. Proceed to verify the CDROM.

3.1 Writing a CDRW

We now have a supply of CDRWs, rewriteable cdroms. The procedure is almost identical to the procedure detailed above, with a couple of exceptions. If your CDRW is brand new (ie has never been written to), proceed as above but note you must use speed=4 for writing the CD. e.g.
cdrecord dev=0,4,0 speed=4 cdrom.iso
If your CDRW has been written to before then proceed to the next section, "Blanking a CDRW".

3.2 Blanking a CDRW

At the moment it is not possible to treat the CDRW as just another disk. Each time you want to write to it you must create an ISO file and record that to the disk. If there is data on the disk, you need to blank the disk first. You do that by issuing the command,
cdrecord dev=0,4,0 blank=all speed=4
This will take about 15 minutes to complete. All data will have been wiped from the disk. You may them proceed as above to write your new ISO file to the cd.

4.0 Verifying the CDROM

The steps to verifying the CDROM are simple.

5.0 Problems

Hopefully you will not need this section, but just in case, here are some of the things that can go wrong. (NOTE: This section will be added to as more documented problems are unearthed.)

I issue a "cdrecord -scanbus" but don't see the CD writer ?

It is likely that the CD writer is no longer responding to SCSI bus commands. Power off the CD writer, wait a few seconds and turn it back on. Try the "cdrecord -scanbus" command again. If this does not work consult your friendly system manager.

Everything seems to have worked ok but I can't mount the CDROM ?

If you see the following when you try to mount the CDROM,
sxt4:~> mount /cdwriter
mount: wrong fs type, bad option, bad superblock on /dev/cdwriter,
       or too many mounted file systems
It is almost certain that the write has failed for an unknown reason. Check the CDROM. Does it look like it has actually been written ? If the answer to this question is no, you might like to try the process again. This time add the -v flag to the cdrecord command and save the output from cdrecord for mailing to your friendly system manager if necessary. e.g.
sxt4:~> cdrecord -v dev=0,4,0 speed=2 cdrom.iso
If it looks like it has written and there were no errors on the screen or if there is an error to do with "fixating", do not add the cdrom to the AOL coaster list. Contact Keiji as it may be fixable.
Help menu Home Page

If you have any comments, please contact www@solar.physics.montana.edu