How to backup and restore a lot of data on to dvds

I’ve recently decided to backup a bunch of files stored on my server to dvds. Since I really didn’t feel the need to install X or any sort of associated desktop I decided to attempt this all on the command line. Here’s my process:

Tar up whatever needs to be backed up into a single tar file:

tar -cvf file.tar ./dir

Next split it into dvd sized chunks. This is only needed if your tar file is greater than 4.3gib. In my case it was about 14gib. Also 4.3gib = 4.7gb, so I don’t recommend messing with the –byte parameter unless you’re using dual layer or some other media type:

split --byte=4300m file.tar filePrefix

Now there should be several files ready to burn to dvd, which you can do with:

growisofs -Z /dev/dvd -r -J -allow-limited-size ./file

Since this is for backup purposes it is a good idea to use md5sums to make sure everything is correct:

md5sum ./file; md5sum /media/dvd/file

Finally in order to restore the tar file, first copy all dvds to the same directory (again I would md5sum to make sure the copies are correct) and:

cat filePrefix* > file.tar

Untar and enjoy! Now this isn’t the most convenient way of storing backups. I’d like to be able to browse the files on the dvd, but it seemed like too much work to figure out good spots to stop copying the file system onto the dvds. For now this will do, should my disk drive start failing I should have a great starting point to recover from.

5 Responses to “How to backup and restore a lot of data on to dvds”