To write a CD you need to:
| The software for both creating the disk image and driving a CD writer
connected to a Unix host is available at
ftp.fokus.gmd.de/pub/unix/cdrecord/.
If you're running SunOS or Solaris you will also need the scg driver
(see the scg section below).
Cdrecord used to be available as either source or binary, but last time I looked there were no binary distributions at the ftp.fokus.gmd.de site. However a binary distribution of cdrecord.1.8a24 and mkisofs 1.12b5 is available at the Solaris Package Archive. This site (and its mirrors) contains packages that can be easily installed with the Solaris pkgadd command. See the README file for further details. I have compiled a
binary
of mkisofs suitable for Suns running Solaris 2. Right-click on the link
and select Save Link As. Then chmod 755 mkisofs and copy it to a suitable
directory.
The rest of this section is only applicable if you downloaded the software from the ftp.fokus.gmd.de site. The file cdrecord-1.6.1.tar.gz contains the source code for both cdrecord and mkisofs, or you can grab a precompiled binary suitable for your system, (such as cdrecord-1.6.1-sparc-sunos5.gz). If you download the cdrecord binary, uncompress it, copy it to (for example) /usr/local/bin and make it executable: gunzip cdrecord-1.6.1-sparc-sunos5.gz cp cdrecord-1.6.1-sparc-sunos5 /usr/local/bin/cdrecord chmod 755 /usr/local/bin/cdrecordThe source code for mkisofs is also available separately in the mkisofs directory of the ftp site as mkisofs-1.12b5.tar.gz. Even if you plan to get the binaries rather than compiling the source, you should download source so that you have the man pages and other documentation. In either case, you will need gzip to uncompress the files. If you want to compile the programs from source, you will need a C compiler such as gcc and a make program. The 'make' that comes with Solaris 7 (/usr/ccs/bin/make) will do, GNU make is better, but Jörg Schilling's first preference is his smake which is available as source or binary (in the "bin" directory). Untar the source and change to the cdrecord-1.6.1/DEFAULTS directory. If you're using gcc, edit Defaults.sunos5, commenting the DEFCCOM= ccline and uncommenting the DEFCCOM= gccline. Also, if you want the executables installed somewhere other than /opt/schily, change the INS_BASE line to read (for example) INS_BASE= /usr/localType make to start the compilation. If all goes well, you can then type (as root) make install to copy the cdrecord and mkisofs binaries as well as the man pages to the location you selected above. See the INSTALL file in the cdrecord-1.6.1 directory for further information. See also the CDrecord release information page. |
The ftp site contains 2 Solaris packages...
SCHILYscg.i386.tar.Z (for Intel based computers)
and
SCHILYscg.sparc.tar.Z (for Suns).
There are also numerous updates to the actual scg driver, all having
filenames starting with scg. At the time of writing (October 1999)
the recommended file for Suns is scg-sparc-sol2.4.beta, even if you are
running a later version of Solaris such as Solaris 7. You can ftp to ftp.fokus.gmd.de/pub/unix/kernel/scg/
and get SCHILYscg.sparc.tar.Z and scg-sparc-sol2.4.beta (make sure to use
binary mode) or you can visit this site with your browser, then select
the required file with your right mouse button and select "Save Link As".
A couple of important notes from the README file in the ftp site:
cp scg-sparc-sol2.4.beta /kernel/drv/scg uncompress SCHILYscg.sparc.tar.Z tar -xvf SCHILYscg.sparc.tar pkgadd -d .When asked if pkgadd should overwrite the conflicting files (i.e. the file you placed in /kernel/drv) answer with 'no'.
So far, I have always written the whole CD in one go. See the file README.multi in the cdrecord source if you want to write multi-session CDs. Another source of information is the Multi-session CD Mini Howto.
Although the type of data is irrelevant, this section shows how I use mkisofs to make a disk image of Varian Nuclear Magnetic Resonance data. On our system the NMR data is kept in a separate partition called "fids". Users have their own data directories, so the directory structure looks like this:
/fids -+- angusfids/ dept.fid cosy.fid etc. | +- harryfids/ . . . | +- jonesfids/ . . . |and so on. To decide which data will fit onto a CD, open an Xterm, change to the /fids directory and type
74284 angusfids 64735 harryfids 39349 jonesfids 2 lornafids 192562 maryfids (and so on)Simply use the numbers on the left (the disk space in kbytes used by each directory) to decide which directories when backed up will consume about 650 Mbytes of disk space. If your requirements are more complex, perhaps because the data to be backed up is mixed up with other things, you may need to copy the required data somewhere before making the ISO file system.
CDs use the
ISO-9660
file system. This uses the restrictive DOS-like naming convention of
"up
to 8 characters, followed by a period, followed by a 3 character extension".
It also adds a semicolon and a file version number to the filename. So
for example the name
a_long_name.fid
would become
A_LONXXX.FID;1
This is not very satisfactory if backing up files from a Unix system,
but mkisofs allows you to create an ISO-9660 filesystem with Rock Ridge
extensions, which allows long, mixed-case filenames. I find the mkisofs
documentation a bit vague concerning which, if any, of the other command-line
options should be used with the "Rockridge" option. It would seem logical
to assume that the "Rockridge" option overrides the -d -D -l -N -L
options (see below).
The command line I now use to create the ISO file system is:
cd /fids mkisofs -R -x./lornafids -x./zeusfids -o /some/disk/backup.img ./The command line I prevously used was:
cd /fids mkisofs -d -D -l -N -L -R -x./lornafids -x./zeusfids -o /some/disk/backup.img ./Either of these will create a disk image which when written to CD, will give a normal looking Unix filesystem. If you're using it to store NMR data, Varian's Vnmr program has no difficulty reading CDs produced by either method.
The -x options are directories to exclude, either because they are empty or contain too much data to fit on the CD. The ./ tells it to back up the current directory. If none of the disks connected to the computer have enough free space to contain the disk image, pipe the image to another computer ...
cd /fids mkisofs -d -D -l -N -L -R -x./lindafids ./ | rsh other_host "(cd /some/disk; dd of=backup.img)"Here also, you can omit the -d -D -l -N -L options.
| -d | omit trailing period from filenames |
|---|---|
| -D | do not use deep directory relocation |
| -l | ("ell", not "one") use long (32 character) filenames |
| -N | omit version numbers from filenames |
| -L | allow filenames to begin with a period |
| -R | use Rock Ridge extensions |
Change to the directory containing the disk image.
It is a good idea to check that your computer can supply data quickly
enough to write the CD at the required speed. You do this using the
-dummy
argument. For example:
cdrecord -dummy -v speed=4 dev=5,0 backup.img
...where backup.img is the name of your disk image, and
dev=5,0
tells it that the CD writer occupies SCSI address 5. Change this to reflect
the SCSI address of your CD writer, eg.
dev=6,0
The "dummy" command above goes through the process of writing the CD,
but keeps the laser turned off. If all goes well, you are ready to write
the CD. Note that some drives need to eject the medium before writing a
new CD. Doing a -dummy test and immediately writing a real CD would not
work on these devices. Press the eject button and then reinsert the CD.
If the CD is not ejected, try
cdrecord dev=5,0 -eject
To write the CD, type something like this:
cdrecord -v speed=4 dev=5,0 backup.img
See the man page for more usage details.
The output should be similar to this...
Cdrecord release 1.6.1 Copyright (C) 1995-1998 Jvrg Schilling TOC Type: 1 = CD-ROM scsidev: '5,0' scsibus: 0 target: 5 lun: 0 atapi: 0 Device type : Removable CD-ROM Version : 2 Response Format: 2 Capabilities : Vendor_info : 'HP ' Identifikation : 'CD-Writer 6020 ' Revision : '1.07' Device seems to be: Philips CDD-2600. Using driver for Philips CDD-522 (philips_cdd522). Driver flags : Track 01: data 629 MB Total size: 722 MB (71:34.30) = 322073 sectors Lout start: 722 MB (71:36/23) = 322073 sectors Current Secsize: 2048 ATIP start of lead in: -11849 (97:24/01) ATIP start of lead out: 336075 (74:43/00) Disk type: Cyanine, AZO or similar Manufacturer: Taiyo Yuden Company Limited Blocks total: 336075 Blocks current: 336075 Blocks remaining: 14002 Starting to write CD/DVD at speed 4 in write mode for single session. Last chance to quit, starting real write in 1 seconds. Waiting for reader process to fill input-buffer ... input-buffer ready. Starting new track at sector: 0 Track 01: 629 of 629 MB written (fifo 100%). Track 01: Total bytes read/written: 659601408/659601408 (322071 sectors). Writing time: 1154.686s Fixating... Fixating time: 126.683s cdrecord: fifo had 10390 puts and 10390 gets. cdrecord: fifo was 0 times empty and 10317 times full, min fill was 95%.
The sformat program can be used to check that the data was correctly written to the CD. If the CD writer is connected to target 5 on SCSI bus 0, the command to verify the CD would be: sformat -verify 5 0
NOTE: The README.verify file states that
Not
all CD-ROM drives support verifying.
This is certainly the case with our CD writer, and attempting to verify
the CD with sformat just produces a stream of errors...
sformat: I/O error. verify: scsi sendcmd: no error CDB: 2F 00 00 00 00 03 00 03 E5 00 status: 0x2 (CHECK CONDITION)... and other messages not listed here.
A quick check of the filesystem can be performed using star, Jörg Schilling's version of the standard Unix tar command.
a7icJFiUjL By : a7icJFiUjL ( Fri Jan 12 22:50:16 2007 )
DVD writing By : anonymous ( Mon Jan 16 20:11:29 2006 )
Files read and write on CD By : anonymous ( Sat Aug 14 15:04:45 2004 )
Re: Writing to a DVD using a Sun Ultra 5 By : anonymous ( Sat Feb 22 01:29:01 2003 )
All CommentsWriting to a DVD using a Sun Ultra 5 By : anonymous ( Fri Feb 21 15:48:02 2003 )
| UNIXguide.net | Suggest a Site |