Notes on writing to all sorts of optical media.

cdrecord

cdrecord will write to CDs and DVDs. The most important options are below, one per line. Pick and choose the ones you need:

sudo 
nice -n 15
cdrecord
dev=/dev/hda
blank={fast,all,help,}
-v
-tao
-dummy
-eject
-speed={12}
-data DATAFILE

I usually use the -dummy option first (you should always do this) to be sure that it will work properly. If it doesn't work, try messing with the write speed.

To blank a CD-RW:

blank={all, fast, ...}

growisofs and mkisofs

growisofs let's you add more data to an isofs. This is mainly used on DVDs, however, it is my recommended way to burn data to any optical media. It handles both mkisofs and cdrecord, so why not learn only one?

-Z starts a new session -M appends to an old session (be sure you use the same options) -r -J uses Rock Ridge and Joliet extensions, so that you can have long file names. (note: from mkisofs)

growisofs's options are closely connected with mkisofs's options. In fact, the only options used below that belong to growisofs are -Z, -M, and the /dev/hda. The rest are passed straight to mkisofs. Thus, you can use the information below for mkisofs as well.

Teaching by examples:

Burn a raw isofs onto a DVD:

growisofs -Z /dev/scd0=data.iso

Blank a DVD so that you can re-write to it:

growisofs -Z /dev/hda=/dev/zero

Add files to a blank DVD. In the root of the DVD will be file1.txt and file2.jpg. For all commands below, you can place however many files on the command line.

growisofs -Z /dev/scd0 -r -J some/file1.txt some/file2.jpg [...]

Add files to continue the session above. This will place file3.txt in the root of the directory.

growisofs -Z /dev/scd0 -r -J some/dir/file3.txt

Now, how to change the names of files when putting them on the CD?

If you use the options -graft-points, you can have a special isofsLocation=originalFile syntax. Below, it places the name file1.txt in the root of the isofs.

growisofs -Z /dev/scd0 -r -J -graft-points file1.txt=this_file_has_a_name_that_is_too_unweildy.txt

This looks similar, except that the destination on the isofs is dir/. Note the trailing slash. This means that it will place file1.txt inside of dir. So, the isofs will have a name at dir1/file1.txt

growisofs -Z /dev/scd0 -r -J -graft-points dir/=file1.txt

Check out the -V "VolumeLabel" option below for mkisofs. This may be useful to use for the first recording session.

mkisofs

I rarely directly use mkisofs, but here are some arguments I thought were important.

-r  # Rock Ridge extensions with read access, owned by root (do this)
-J  # joliet extensions for win32   # (can be combined with -r)
-o  # output file
-hfs
-V "volume label"  # What the name of the disk will be. 
-graft-points #use this to have smarter directory paths.
    # a/directory/=file_or_dir   # puts file_or_dir into a/directory/
    # a/place=file_or_dir  # (note trailing slash) puts file_or_dir at a/place

You must put all options before the directories to include.

Local Notes

For zarankiewicz new, use cdrecord -v dev=/dev/hda speed=20 -data XXXX (it seems to underrun at higher speeds!)

DebianNotes/OpticalMedia (last edited 2008-07-22 21:48:13 by RichardDarst)