I tend to create DVD archives of data. I’ve always done this in Windows using Nero to burn my archives and then I store them in a cool dry place. Since I tend to keep everything on my headless Etch server in the basement now, I need a new way to burn off/save my data. I spent some time this afternoon reading up on creating ISOs and burning them.
Note: I did all of this as
First, creating an ISO image. What I need to do is create an image from a directory of goodies that I need to back up. The directory I’m backing up contains 4.4G (or one single layer DVD) of random MP3s and I want them written to the root of the DVD when it’s finalized.
I started by reading the man page for
mkisofs. That got me started, and then a quick read of http://wiki.linuxquestions.org/wiki/Mkisofs finished me off. My first few attempts just gave me ISOs containing MP3s with short filenames or short filenames in all CAPS. Not what I wanted, these are all descriptively named files and I want to retain the names. The command below worked perfectly.
mkisofs -r -J -l -d -joliet-long -allow-multidot -V Mp3_003 -o ./Mp3_003.iso _Archive/Mp3_003/*
All of those options are important,
-r makes the files publicly readable (among other things),
-J preserves case (upper/lower),
-l allows long filenames,
-d doesn’t add a period to the end of files that don’t have them,
-joliet-long allows up to 103 characters (vs 64),
-allow-multidot allows files to contain multiple periods and
-o specifies the output file name, . Optionally, (but why wouldn’t you)
-V sets the DVD’s Volume name (up to 32 characters). As is typical, there are many more options available to you, spend a little time reading the man page for more info.
-joliet-long was key for me. I found that when I attempted to read files with filenames longer than 64 characters on Windows, they would be truncated and NOT in a good way. The filename would be truncated in reverse, starting with the file extension. A 65 character file with a .MP3 extension would end up with a .MP extension. Ugly. That said, the man page warns that this breaks the joliet specification and to use with caution. You’ve been warned.
After a few moments you’ll have an ISO image containing all of the files you specified. In my case, all of the MP3′s I’ve collected since I burned my last backup.
Now to write it to my media:
cdrecord -v -sao dev=/dev/dvd Mp3_003.iso
-v sets verbose mode,
-sao enables session at once (no multi-disc),
dev=/dev/dvd specifies the device to use and finally, the input file;
Mp3_003.iso. There are A LOT of options available to you, you’ll want to spend a little time with
Note: You don’t need to specify the device if you have a properly configured
/etc/wodim.conf. If you’re wondering why it isn’t
/etc/cdrecord.conf, the answer is that
cdrecord is nothing more than a sym link to
/usr/bin/wodim on Debian (and possibly other distros). You can verify this on your box with
which cdrecord | file -f -.
My first write failed but it was because I have two VMware virtual machines running on this box and they were attempting to poll the CD-ROM drive for media. The fix was to disconnect the drives in the VMs and then burn.
The resulting CD should be readable in any modern OS. I have no problem accessing the files from Linux or Windows and feel confident that I have a solid solution for creating DVD archives.