Jan 14

While working out a strategy for DVD backups on my server I found some handy tools for working with ISO files. I used some of these to prevent wasting media on test burns (sure, re-writable media would be good, but why not live on the edge and toast all of your WORM media?).

isoinfo:

This is the one that saved me from wasting (a lot of) media so I’ll start with it. Since I need to create DVDs that can be read both in Windows and Linux I create my media utilizing both the MS Joliet specification and Rock Ridge standard. Basically, both of these extensions to the ISO9660 standard allow for additional file information to be stored on CD/DVD (long filenames, permissions and so on).

Initially I was attempting to create an ISO containing files with names exceeding 64 characters. Joliet technically only allows for 64 and was doing awful things to my file names (umm hello, truncating the extension?). Isoinfo (isoinfo -i <iso> -lJ) allowed me to see that the Joliet filenames were broken. Had I burned that DVD it would have appeared fine on my Linux machines (as they would be referring the RR data on the DVD) but would have been been a problem on my Windows boxes. Just that command saved me at least two discs :)

Handy isoinfo commands:

isoinfo -i <iso> -lJ: View info from Joliet extensions
isoinfo -i <iso> -lR: View info from RR extensions
isoinfo -i <iso> -d: View ISO’s properties

isovfy:

Isovfy’s man page states: isovfy is a utility to verify the integrity of an iso9660 image. Most of the tests in isovfy were added after bugs were discovered in early versions of genisoimage. It isn’t all that clear how useful this is anymore, but it doesn’t hurt to have this around.

Lack luster description, I personally don’t know how useful it is either but I figure that if you download an ISO, it couldn’t hurt to run this proggie on it for a quick sanity check.

isovfy <iso>

isodump:

Yeah, this one is a mystery to me. I personally couldn’t find a human use for this one at all. isodump is a crude utility to interactively display the contents of iso9660 images in order to verify directory integrity. The initial screen is a display of the first part of the root directory, and the prompt shows you the extent number and offset in the extent.

Feel free to try it on your ISO, just keep in mind that the man page is accurate, it’s crude. Personally, I get what I need from the other two utils so I’ll just forget about this one.

That’s all I have on ISOs for now, check out the wikipedia links throughout the post, if you’re a little geeky it’s interesting reading :)

written by M@ \\ tags: , , , , , , , , ,

Jan 11

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 root

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.

Note: -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 man cdrecord.

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.

written by M@ \\ tags: , , , , , , , , , ,