Previous Section  < Day Day Up >  Next Section

Recipe 11.11. Recording Data DVDs

11.11.1 Problem

You want to record data files on DVD, such as backups, image galleries, or Linux installation discs from .iso images.

11.11.2 Solution

Use growisofs, from dvd+rw-tools. Before you touch anything, make sure you do not have automount or supermount enabled for your DVD writer. Supermount/automount will guarantee a coaster.

Copying files from a hard drive to DVD is done in one step:

# growisofs -Z <device name> <mkisofs commands> <files>

For example:

# growisofs -Z dev=1,2,0 -dvd-compat -udf -R -J -v /home/carla

It is easy to add more files to the DVD. Always use the -Z option for the first batch of files written to the DVD, then use the -M flag for all additional files:

# growisofs -Z dev=1,2,0 -dvd-compat -udf -R -J -v /etc

# growisofs -M dev=1,2,0 -dvd-compat -udf -R -J -v /shared/projectfiles

# growisofs -M dev=1,2,0 -dvd-compat -udf -R -J -v /var/www/public_site

There's no need to explicitly close and fixate the disc.

You may also write .iso images; for example, when you want to create a Linux installation disc on DVD:

# growisofs -Z dev=1,2,0=KNOPPIX_V3.4-2004-05-17-EN.iso

11.11.3 Discussion

An increasing number of Linux distributions are becoming available on DVD-sized .isos, and none too soon, as some take up eight or more CDs.

growisofs replaces cdrecord, and is a frontend to mkisofs, so you get to use the same, familiar mkisofs options, with these two exceptions:

  • Don't use -o to specify an output file, because growisofs writes directly to the DVD.

  • Don't use -C, because growisofs figures out the starting and ending points of tracks all by itself.

-dvd-compat helps to ensure compatibility with the majority of DVD drives.

-udf adds limited udf support. As this was written, packet writing was still not reliably implemented in the Linux kernel. This can be left out, though the price of including it "just-in-case" is just a few bits of extra metadata.

There are RPMs, Debian packages, and tarballs for dvd+rw-tools. The tarball also includes a spec file, if you want to roll your own RPM.

It's not necessary to format new DVD-RW discs, because from version 5.10 growisofs does it automatically as you add files to the DVD. To get your version number, run:

$ growisofs —version

supermount is supposed to enable inserting and removing disks, like floppies, without having to enter mount and unmount commands. It is starting to appear on Red Hat, SuSE, and other distributions, and is usually enabled by default.

To disable supermount temporarily:

# /usr/sbin/supermount -i disable

Use -i enable to reenable it. Unfortunately, supermount doesn't work very reliably yet, so you might be better off disabling it permanently. Remove supermount entries from /etc/fstab to do so. To get rid of it with extreme prejudice, remove the magicdev package:

# rpm -q magicdev

or in Debian:

# apt-get remove magic-dev

11.11.4 See Also

    Previous Section  < Day Day Up >  Next Section