Making the iso Image (or How I Learned to Master My Data)

Making the iso Image (or How I Learned to Master My Data)

I fear buffer underruns. A buffer underrun occurs when the system can't feed data to the burner fast enough, and the end result is a coaster ”a CD-R that can't be read. With fast machines, it is possible to stream the data directly to the CD-R, but I don't like to do that.

Get all the files you want on a CD-R into the directory structure you want on the CD. That is, if you've got a bunch of photos you scanned and a handful of wav files you made and some old e-mail you want to categorize, you can try a structure like this:

 cdstuff 
 +-> email 
 +-> photos 
 +-> sounds 

Get everything in its proper place. Once you cut the CD, you can't redo it without using another blank. CD-R drives are technially WORM drives : "write once, read many." So this is definitely a case where you want to measure twice ”because you can only cut once.

Watch your size, as well. I usually keep it to a total of 645MB or so ”I'd rather waste 5MB than a blank CD. The du -sh command will give the size of any directory and its contents in megabytes.

Now that you've got all the files there, you're ready to cut yourself a data CD. The mkisofs will take all your data and massage it into a CD-ready format. The format is pretty simple, though the man page is a bit daunting. I always burn my CDs with Joliet extensions enabled. This ensures I can read them if I don't have access to a Linux box. I've pretty much memorized the following string, and feel free to copy it. First, the generic format:

 mkisofs hide-joliet-trans-tbl -J -p <preparer> -V <volume-name> -r -A <some comment> -o <output-file> <directory-name> 

In practice, it tends to looks like this:

 mkisofs hide-joliet-trans-tbl -J -p me -V old_email3 -r -A "just some crap I want to keep" -o email3.raw /home/jeremy/email3_dir 

See all those neat error messages you get for deep files (ones in multiple directories)? Those are just the way mkisofs says, "Hello! I'm doing something!" Don't worry too much about them. If you really want to know why they're there, check out the mkisofs man page. At the end, you get a nifty summary, which looks something like this:

  Total translation table size: 0  
  Total rockridge attributes bytes: 115029  
  Total directory bytes: 256000  
  Path table size(bytes): 946  
  Max brk space used a1424  
  4783 extents written (9 Mb)  

Make sure that the size listed is about the same size as the sum of the files you wanted on the CD. Then use isovfy to verify it:

  isovfy email3.raw  

It'll say something like

  Root at extent 1c, 12288 bytes  
  [0 0]  
  No errors found  

and you can continue on to the next phase: mounting it.

This is relatively simple ”just mount the ISO file to a mount point, and look at it for a few minutes and make sure everything is there. This command should get you up and running:

  su -c"mount -o loop -t iso9660 /data/email3.raw /mnt/cdrom"  

Feel free to substitute any mount point for /mnt/cdrom, and be sure to specify the proper name of your iso file. I always call mine .raw instead of .iso. I don't know why, it's just something I do. If you want to call yours .goofy, knock yourself out ”this is Linux, after all. A file extension doesn't have to mean anything.

Great, now we've got a working iso image. Go ahead and unmount it. If you weren't able to browse the image properly, make sure you have plenty of disk space on your system. Running out of disk space can mess up an iso image (and lots of other things, too). It's time to think about cutting it to a CD-R or CD-RW.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net