zfs q regarding backup strategy
steve at sohara.org
Fri Oct 1 21:28:23 UTC 2021
On Fri, 1 Oct 2021 15:14:08 +0100
tech-lists <tech-lists at zyxst.net> wrote:
> What I'm looking for is something (ideally) written in sh. Or even perl.
> But even before that, need to understand incremental backups properly.
> Basically the backup needs to be (effectively) write-only. By that, I
> mean only added to.
With zfs send every stream is a send up to some 'target' snapshot,
a full stream is the complete history while an incremental stream is from
an earlier 'source' snapshot.
It is therefore necessary for any successful incremental backup
system to know what the last snapshot sent was so that the next cycle can
start by creating a new snapshot and sending the increment from the last
sent to the latest. On the receiving end the options are to either store
each send as a file named in such a way as to make it obvious what order to
process them in should restore be needed or (more usefully) to use zfs recv
to load them into filesystems in a pool on the receiving machine. If you do
this there will be no pruning of the received snapshots unless you set
something up to do it.
This sounds nice and simple and is the basis of most homebrew and
packaged zfs replication systems - proper error handling is *difficult*
especially handling errors in the zfs recv phase. Also there is the
irritating detail that one of the properties of a ZFS filesystem is its
mount point and while you can run zfs recv in such a way as not to mount
the received filesystems they will get mounted on reboot which makes
backing up several root filesystems to an archive server a little tricky!
The bad news is that I haven't found a solution I really like,
zrepl comes close but it solves that last problem by dropping *all* the zfs
properties in the archive and I'm pretty sure it ignores some error
conditions that eventually lead to an incomplete backup. What I really want
is a rok solid reliable archive server with all the hierarchies archived
mounted read only under something like /archive/<source>/. I haven't got it
Steve O'Hara-Smith <steve at sohara.org>
More information about the freebsd-questions