Backing up freebsd to 1 file?

Warren Block wblock at wonkity.com
Sun Apr 18 15:39:58 UTC 2010


On Sun, 18 Apr 2010, J.D. Bronson wrote:

> I have a freebsd 8.0 install and was wondering if it is possible to tar up 
> the entire install...for backup purposes.
>
> # cd /
> # tar -cvf backup.tar {list of directories}
>
> then I can ftp the tar file out to another machine.
>
> This works in theory, but if I need to do a restore tar complains
> on 'tar -xpf backup.tar'.

As others have mentioned, tar is not well suited for this.

> Under OpenBSD, this works as expected. It has given me an easy way
> to backup/move/restore or anything I want to do w/o complaining.
>
> I am running Freebsd on a machine that has no other drives/tapes or anything 
> so my options for backup are limited.
>
> All I am trying to do is get a complete image (or snapshot) of my entire 
> install on this machine and then if I needed to reload or reinstall, I could 
> do a bare bones freebsd install, copy over the tar'd up file and extract it 
> from within / and then reboot an I would be go to go.

If you don't have any other drives, where will the backup file be stored 
so it survives a system failure or reinstall?

> Thoughts on this would be appreciated...

dump/restore is the standard safe way; you can send it over ssh to back 
up to a file on another machine.  Sometimes people use dd, which can be 
effective if you use some tricks like filling unused space with zero so 
compression is effective.

There's another option.  I've mentioned clonezilla.org here before as a 
way to back up Windows systems; it's fast and only copies used sectors.

Newer beta versions of clonezilla now support UFS directly, so they can 
back up FreeBSD disks.  This is nice because it also backs up the MBR, 
and splits the backup files into 2G increments.  It may also be faster 
than dump/restore.  Note that I only noticed the UFS mode lately and 
have only tried it once so far, so no real experience on how safe it is 
yet.

-Warren Block * Rapid City, South Dakota USA


More information about the freebsd-questions mailing list