Backing up freebsd to 1 file?

Polytropon freebsd at edvax.de
Sun Apr 18 14:10:18 UTC 2010


On Sun, 18 Apr 2010 08:23:12 -0500, "J.D. Bronson" <jd_bronson at sbcglobal.net> 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'.

In this case, you're better using dump partition-wise, or
just use dd to copy the whole disk - this may lead to large
files, so adding compression is often useful.



> 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.

What exact complains are output by FreeBSD's tar?



> I am running Freebsd on a machine that has no other drives/tapes or 
> anything so my options for backup are limited.

Note that dumping / restoring (especially restoring) is more
easy to be done by booting from a live system (e. g. via CD,
DVD or USB).



> 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.

Well... tar is not so good suited for that. There are things
at file system level that are important to the system, but are
not honored by the tar utility. In this case, dump + restore
provide excellent means for what you're intending. In case of
a failure, use a FreeBSD boot medium with sysinstall or sade
to prepare the disk (slice, partition, newfs), then restore
the dump files to the partitions, reboot, and it's done.

Of course, dd provides an exact 1:1 copy, and you can choose
to copy partitions, slices, or a whole disk. The dump and
restore programs operate on file systems (partitions), while
tar operates on files.



> Thoughts on this would be appreciated...

There are some threads in the archives about how to backup
or clone a whole system. You'll find some more inspirations
and considerations there.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list