Tuesday, February 27, 2007

Creating Large (>2GB) DVD Backups Under Linux

I recently created a large tgz backup archive (4.2GB) and wanted to burn it to DVD. No problem, I thought, standard DVD's hold 4.7GB. But the Gnome desktop CD/DVD Creator kept silently failing. I jumped down to command line, and tried to manually make an iso image with mkisofs. I kept getting this error:
mkisofs: Value too large for defined data type. File backup.tgz is too large - ignoring
After some digging, I found that mkisofs won't handle files greater than 2GB. There is a workaround, however - growisofs can burn files directly to a device, skipping the ISO9660 filesystem creation step (I'm assuming here that /dev/dvd is a symlink to your real DVD burner. If not, the real device name could be /dev/hdc or /dev/scd0, for example. A 'dmesg | grep -i dvd' should tell you what device to use):

growisofs -dvd-compat -Z /dev/dvd=backup.tgz
This worked fine, however now the files on the DVD have to be accessed directly, as if they were on a tape device (you can't mount the DVD, since there is no filesystem on it). Here is how you can test the DVD you just created, if it works you should see the list of files in the tar archive displayed on standard output:

tar tzvf /dev/dvd

1 comment:

Tom said...

You can create an UDF filesystem with all the files you like to burn to DVD using "genisoimage".

Example:
genisoimage -o isofile.iso -udf -allow-limited-size file1 file2 file3 ...

The options "-udf" and "-allow-limited-size" are important!

Then you burn the "iso" file (which contains an UDF file system rather than an ISO one) to DVD using growisofs as described in your article.

When accessing the DVD, just

mount -t udf /dev/dvdrom /mnt

(iso9660 will not work).

Have fun!