zfs q regarding backup strategy

Steve O'Hara-Smith steve at sohara.org
Sat Oct 2 10:54:55 UTC 2021

On Fri, 1 Oct 2021 16:10:44 -0700
David Christensen <dpchrist at holgerdanske.com> wrote:

> On 10/1/21 14:28, Steve O'Hara-Smith wrote:

> The one time I tried booting a system with two OS drives, two boot 
> pools, and two root pools convinced me to never to try that again.

	Been there, done that, rebuilt the system!

> My backup plan for OS instances is to take an image of the device with 
> dd(1).  For this reason, I keep my OS instances small enough to fit on 
> "16 GB" devices and use one device per OS instance.

	Sounds like a good strategy, I'm relying on mirrors and simplicity
for OS images currently.

> > 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!
> Are you referring to the zpool(8) property 'altroot'?

	If only it were a persistent property it would be more useful and
if it were available at filesystem level.

> I recall that FreeNAS uses altroot, and it is persistent across reboots. 

	Oh now that's a neat trick.

>   I wonder how they accomplished that?  Import scripts on boot and 
> export scripts on shutdown?  But, how to deal with an unclean shutdown 
> and/or failed export?  STFW I do not see any clues.

	Thinking about it I'd guess they register the altroot in some
database (append to a text file perhaps) at the time they set it on
receiving the initial stream for the filesystem and creating the
filesystem, then as you say use a boot time script to restore the altroot

	I wonder if the FreeNAS solution is available for use, I only see
some python libraries in the ports.

> Perhaps a top-level "archive" pool, one ZFS volume per <source>, one 
> pool per volume, and some work-around to achieve persistent altroot's (?).

	A separate pool for each archive ? I don't like that pools are
rather inflexible things, I rather want to share that stack of big disks.

Steve O'Hara-Smith <steve at sohara.org>

More information about the freebsd-questions mailing list