fsarchiver as a faster alternative to dd-based backup

Using dd on a mostly-empty disk to create a backup image for convenient restoration is overkill, and copying all those zeros takes time and space.

After preparing the system to taste, boot from an Ubuntu LiveCD (just did this with LiveUSB 11.10) and run:
sudo vi /etc/apt/sources.list # enable 'universe'
sudo apt-get install fsarchiver
sudo fsarchiver savefs -z1 -j4 -v /path/to/backup_image.fsa /dev/sda1

…where ‘z1’ says to do the bare minimum compression (I’m not really concerned about compressing meaningful files, just ignoring empty space), ‘j4’ says use up to 4 threads for compression (my current system is quad core), and ‘v’ says to be somewhat verbose. Without the ‘v’ it just stares at you and I hate long-running jobs that don’t provide any feedback.

When doing a restore to a previously-used drive, if you want to wipe the unused disk space to eliminate any traces of the prior installation, you can use sfill:

sudo apt-get install secure-delete
sudo -v sfill /path/to/mounted/filesystem

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s