Monday, October 18, 2010

Split for burning large backups to a DVD.

The other day I was getting my backups ready to restore my Archlinux install onto a larger hard drive. I don't delete any packages that pacman downloads. I just move them out of the /var/cache/pacman/pkg/ to /var/cache/pacman/old/. This is just to make sure that no matter what happens I can rollback to any package that I've used. Which I do quite a bit when switching from radeonhd drivers to the ATI drivers. I have to switch out xorg and boot to an older kernel.

Anyway, /var/cache/pacman ended up being about 16GB from over 1.5 years of pulling down packages. I wanted an easy way to copy the whole directory to a couple dvds for easily copying to the new disk. I was asking notklaatu on irc if he had any ideas and he told me that I could use tar, split, and cat to do all this. I could tar the folder and compress it. Then, run split to divide the large file into smaller files that would fill up the entire dvd. Burn the files to the dvds and then use cat to rebuild the original compressed tar. So here are the commands that I used to tar, split, burn to dvd, and rebuild the archive

$ tar cf ~/pacman.tar /var/cache/pacman
$ split  -b 2240m ~/pacman.tar split.pacman.tar.
$ growisofs -Z /dev/sr0 -udf split.pacman.tar.a*
$ cat ~/split.pacman.tar.* > ~/pacman.tar

This is all that it took for me to backup 16GB to 4 dvds, I also decided to back up my digital photos and some of my other digital media with this method. It saved me a lot of time in k3b making data dvd's. burning 8 files was a whole lot easier than burning 9000 or whatever what in that package folder. Hope this helps out someone.

No comments:

Post a Comment