Backing up freebsd to 1 file?

Chris Rees utisoft at googlemail.com
Sun Apr 18 14:46:15 UTC 2010


On 18 April 2010 15:37, Sergio de Almeida Lenzi <lenzi.sergio at gmail.com> wrote:
> I am very happy with the folowing....
>
>
> Supose that you have mount ANOTHER device on /mnt....
>
> 1) mount /dev/xxxx /mnt
> 2) init 1  (this closes all applications and drop into single user)
> 3) tar --one-file-system -cvzf /mnt/backup.tar.gz ./ var usr home
> 4) umount /mnt
> 5) exit (reboot from single user to normal operation)
> ===================================
> on restore.......
> supose you install a FBSD minimal from the CD/usb.....
>
> 1) mount /dev/xxxx /mnt
> 2) tar -xpvf /mnt/backup.tar.gz -C /
> ........................
> 3) umount /mnt
> ===========you have restored your system=============
>
> may be some files (sockets...) are not restored but no problem as
> they will be created by the time your system boots on.

Nice answer by Sergio, but I personally would use the j option with tar
to compress to bzip2;

3) tar --one-file-system -cvjf /mnt/backup.tbz ./ var usr home

Though I prefer personally to use dump/restore because:

- If you're on UFS, you don't have to single-user the system, just use
the L option (live filesystem)
- Restore has an awesome 'interactive' mode
- See Zwicky [1]

I'll send you my dump scripts if you're interested. It's dead easy to use!

Chris

[1] http://www.coredumps.de/doc/dump/zwicky/testdump.doc.html


More information about the freebsd-questions mailing list