Subject: Burning a CD-R under NetBSD 1.4.1
To: Dave McConnell <davem@eastcoast.co.za>
From: Stuart Brooks <stuartb@cat.co.za>
List: port-i386
Date: 01/18/2000 11:22:28
This is a simple how-to which works for me.

There are two ways to write a CD. Either (1) An image file is created and
and then written to CD or (2) The CD is written on the fly. I have not
experimented with the 2nd option but the process just involves streaming.



Step 1. Create a raw image file of the file system.

To do this use 'mkisofs' (I have used  v1.12b4). What this does is it takes
a file system (or tree or whatever) and stores it into a raw file in iso9660
format which is the format a CD uses. This file can then be written to the
CD.

My syntax:

mkisofs -L -a -R -o cdimage.raw /usr/500

-L  This allows writes files with a leading dot as is and doesn't change the
dot to an underscore
-a  Writes all files in the directories. Otherwise it ignores files it
thinks are temporary (those ending in ~)
-R  Use the Rock Ridge protocol which adds extra information to the ISO9660
standard. This is important as it seems to preserve long file names which
are otherwise truncated to (8.3).

cdimage.raw
    The file we are creating
/usr/500
    In this case is the root of the tree to copy into the raw file.



Step 2. Check if the file is valid

To do this it needs to be mounted as an iso9660 file system and 'vnconfig'
needs to be used to set up one of the vnd devices. (This information was
posted on the group by Federico Lupi and I just add it here for
completeness)

Make sure vnd0 is unconfigured and /mnt is free. Then ...

vnconfig -v /dev/vnd0 cdimage.raw 512/xxx/1/1
; xxx is the number of 512 byte blocks in the file ie. (filesize div 512)
mount -r -t cd9660 /dev/vnd0c /mnt

... Check directory /mnt   (NB readonly) Then ...

umount /mnt
vnconfig -u /dev/vnd0



Step 3. Write the CD

Once this has been done the file then has to be written to a CD. Currently I
am using a RICOH MP6200S on SCSI bus 0, target 1, Lun 0. It has been
detected on /dev/cd0. TO write to it in single speed I am using 'cdrecord'
v1.6.1 :

cdrecord -v speed=1 dev=/dev/cd0d:1,0 cdimage.raw

-v  More verbose output
speed
    1,2,4... depending on the device and its reliability
dev=/dev/cd0d
    The device is cd0d
1,0 Stands for Target,Lun.
    If a different bus is used then the numbers Bus,Target,Lun would be
used.

Double speed writing on this device hasn't worked but I'm not sure if it
supports 2X since it is an old (2.5 yrs +) device.