The Digital Cave

Primitive Life in a Technological World

 

DVD Backup and Archiving

A common problem found by anyone with a digital camera is how to ensure that you will still have your pictures 10, 20, 50 years from now. Of course, while digital files have the advantages of easy copying, small physical size, etc, if you are not careful, a hard drive crash can make you lose all your photos.

There is of course no silver bullet to maintaining your files - the best defence is a multi layered backup strategy, including online local backups, read only copies, and offsite backups. Local backups are easy enough with automated tools like Time Machine, and remote backups are limited only by your contacts or cash (if you have no friends able or willing to do an rsync exchange with you).

Thus, this page deals with offline, read-only archival copies. The most common (and cheapest) form of offline storage is of course burnable CDs or DVDs. While these would appear to be the perfect answer to your storage needs, some problems with burnable DVDs make it slightly less appealing. The largest problem, in my opinion, is that the dye which makes the disks recordable tends to degrade over time. In some conditions, you can expect a DVD to be unreadable in a few years. This of course makes it impossible to rely on them for your long term storage needs.

A partial solution to this is Par2. Par2 allows you to create parity archives which allow you to create files with redundant data, which can help you recover information from partially corrupted DVDs.

What I do is burn a DVD with whatever files I want; I then copy it to disk using dd, and create a 100% parity archive against the disk image. I then burn this archive to another DVD.

To recover a partially corrupted DVD, you must first save an image of the corrupted disk; you can then restore the image from the parity archive, and re-burn (or just mount) the disk image.

Commands

You can make disk images using dd; if a disk is corrupted, you can use the following options: dd if=/dev/hda2 of=/tmp/disk.iso bs=4m conv=noerror,sync Of course, change 'if' to your disk drive, and 'of' to the file you want to create.

To create a par2 archive with 100% redundancy, use the following command: par2 c -r100 par2 disk.iso You must then burn the resulting par2 files to another DVD. I also include a text file README.txt along with the par2 files, which describes how to restore the disk: PAR2 Parity Disk
This disk can be used to restore partially or completely damaged disk. You will need both this disk as well as the original disk (this will probably be labeled the same as this one, but without the 'par2 Parity Volume' label).

1) Insert the CD and copy it to your hard drive using the command 'dd if=/dev/XXXX of=disk.iso bs=4m conv=noerror,sync'. (Replace XXXX with the device name for your CD Rom, e.g. 'hd2' or 'disk1s2'). The disk image *must* be named 'disk.iso'. If you cannot copy the image due to physical disk damage, you can try the ddrestore tool: 'ddrescue -i <start_position> -n -v <infile> <outfile> <logfile>')
2) Copy all files from this disk to the same location that you copied disk.iso to
3) Run the command 'par2 r par2'
4) Assuming the command completes successfully, you should have restored disk.iso to its correct state. You can then open this disk image directly, or burn it to CD again

To restore a partially corrupted disk image, use the following command: par2 r par2