Saturday, January 15, 2005

DVD backups in Linux

Suppose you have a RedHat linux box and you buy a cheap DVD+/-RW drive for it. Then you want to backup to it. Let's suppose, it's a ATAPI drive.

You have to do 3 things:

1) munge with your kernel, modules.conf, and lilo.conf. If you've a 2.4 kernel that's less than a year or so old skip the kernel munging.

Modules.conf has to know to ignore the ide-cd associated with your drive. On mine, dmesg told me it was located at hdc. Check your machine. Then add these two lines:

options ide-cd ignore=hdc
pre-install sg modprobe ide-scsi

Lilo.conf has to load the ide-scsi aliasing module that makes cdrecord and dvdrecord work right. Add the line between the dots. (don't add the dots)

image=/boot/vmlinuz-2.4.18-3
label=linux
initrd=/boot/initrd-2.4.18-3.img
read-only
...
append="hdc=ide-scsi"
...
root=/dev/hda2

2) Then you have to make an iso fs image of your cd or dvd with makeisofs. I used the nautilus burn-cd menupick, but it hung when it got to the cdrecord (and dvdrecord) steps, because I had failed to do the module.conf and lilo.conf steps described above. So, read the makeisofs man page instead of me.

3) If you're going to write your newly created iso file to a CD-ROM, you'll want to utter this command-line incantation:

cdrecord -scanbus

That'll tell you if it can see your DVD or not. When you get something useful in reply to that command, issue another like this:

cdrecord fs=12m speed=16 image2.iso

This will crunch away giving you nice feedback about how well the process is going.

After you've satisfied yourself with the correctness of the CD-ROM you've created, you may want to create a dvd-rom. Here's the incantation mine wanted:

dvdrecord dev=0,0,0 fs=12m speed=4 -dao image.iso

That -dao came about after the first attempts failed b/c my drive doesn't support TAO. Obviously, not a buddhist dvd recorder despite its asian origins. TAO means track at a time, and DAO means disk at a time. You do need faith when you utter this command, because when I did so, it went a long time before completing without any intermediate status info.

After creating my CD-ROM and DVD-ROM backups, I proceeded to carry them to a nearby Windoze laptop that verified it could indeed read their contents.

No comments: