TCM
UoC crest

How to burn a DVD or CD ROM

The concepts

There are two stages to making a CD or DVD. Firstly one must make an image - that is, an exact representation of what must be burned onto the disk. Then one must transfer it to the CD or DVD.

With a conventional disk one can update directory entries and used block lists as each individual file is copied to the disk. With cheap optical media one cannot update a portion of the disk, and life is simplest if everything is written in a single pass over the disk.

The quantity of data to be burnt will determine whether you want a CD (up to about 750MB), a DVD (4.7GB) , or a dual layer DVD (8.5GB).

Burning an existing ISO file

DVDs

$ growisofs -dvd-compat -Z /dev/dvd=./image.iso

And that is it, replacing ./image.iso by the name of your ISO file.

CDs

$ cdrecord -v /scratch/myimage.iso

Even simpler. Note that older CD drives really dislike burning from ISOs which are on a network drive, and thus might suffer from periods of poor transfer rate. Hence this example uses an ISO file first copied to the local /scratch disk.

Burning without an existing ISO file

DVDs

The recommended command is again growisofs, and, like most other UNIX commands, it is documented by man growisofs.

$ growisofs -Z /dev/dvd -r -T ~

might work for making a backup of your home directory.

CDs

For a CD one needs to make the iso image explicitly.

$ mkisofs -r -T -o /scratch/myimage.iso ~
$ cdrecord -v /scratch/myimage.iso

might work for making a backup of your home directory.

(Windows users will want to add a -J to the mkisofs command line, for Windows uses ISO9660 with its own Joliet extensions, whereas everything else uses Rock Ridge extensions. Plain ISO9660 restricts filenames to the 8.3 characters of old versions of MS DOS.)

Mistakes

Everyone makes the same mistake with mkisofs and growisofs. They assume that

$ mkisofs -r -T -o /scratch/myimage.iso thesis papers programs

will create an iso image containing the three directories thesis, papers and programs. It won't. It will place the contents of those three directories into the root directory of the iso image. The hideous syntax to do what was wanted is

$ mkisofs -r -T -graft-points -o /scratch/myimage.iso thesis=thesis papers=papers programs=programs
or
$ growisofs -Z /dev/dvd -r -T -graft-points thesis=thesis papers=papers programs=programs

which is almost enough to make one want to use a GUI!

Testing the result

The CD/DVD should be mountable:

$ mount /cdrom
$ ls /cdrom
myfile    myotherfile     myusefulfile
$ umount /cdrom

The slightly paranoid can try testing the CD by, after mounting it,

$ tar -cvf /dev/null /cdrom

which should create an archive of everything on the CD, and throw the archive away by writing it to /dev/null. Without the -v it will not list the files as it goes.

Finishing off

1/ Remove any image files from /scratch
2/ Take the CD/DVD with you...

Miscellaneous

Most DVD drives support both the DVD+R and DVD-R formats. The official standard is -R, whereas +R is (arguably) technically superior, and more immune to buffer under-run problems.

pc52 has a dual layer DVD drive, though the computer in front of you might not.

It appears that the drive on pc52 sometimes gives a timeout error when starting to write, particularly with dual layer media. Re-issuing the growisofs command usually fixes this...

I see little point in re-writable CDs or DVDs, so have said nothing about them. Does one not use USB memory sticks at this point?