zfs snapshot management

Graham Todd gtodd at bellanet.org
Thu Jun 9 14:44:55 UTC 2011

On 06/05/2011 22:32, Charles Sprickman wrote:
> Hello all,
> I've been using a few different tools to manage zfs snapshots in different
> scenarios. For local use, I've found that Ralf Engelschall's set of
> scripts[1] that tie into the periodic(8) system work fairly well. I do
> not use the amd portion since I am only working with zfs snapshots and I
> don't see a need to actually re-mount the snapshots elsewhere for
> recovery. The only limitation I find with this system is that for use on
> a backups host the lack of a monthly or yearly retention period pretty
> much rules it out. For local "oops" stuff though, it's great.

FYI there's even a "port" of Ralf's tools (which I maintain). The scripts 
are pretty straightforward so the port is rather superfluous, but some 
people like to use ports for policy reasons and the like.

To my mind the RSE snapshots tool excels at presenting a unified view of 
snapshots on a system that has a mixed UFS/ZFS filesystem layout. The 
script could be modified to account for different properties of UFS and 
ZFS fairly easily. e.g. ZFS obviates the need for certain subcommands 
(like "snapshot visit" which does not need to mount anything if the 
snapshot being "visited" is in a .zfs directory) and/or to increase the 
retention period (to work around the limit on the number of snapshots that 
a UFS filesystem can retain) but I'm not sure this would be all that useful.

A better way to go might be to just wrap a generic "snapshot" command 
around subcommands and related periodic scripts in a plugin-ish/modular 
way to handle various mixtures of zfs ufs.  Of course one day maybe "all 
our ufs are belong to zfs" (as ZVOLs) which might change things a bit. I'm 
not sure if UFS/SU+J will affect anything regarding snapshots on UFS ... 
maybe they'll be faster to create?

Anyway, this was very useful thread. Snapshots are great and luckily 
there's lots of tools to choose from.

PS: Note to self: snapshots != backups :)

> For hosts acting as backups servers, I've been using Snapfilter[2] and
> some cobbled together stuff that rsyncs a bunch of hosts and tries to
> detect and notify on errors. Snapfilter simply is the zfs snapshot
> "sweeper" that periodically deletes snapshots that are outside the defined
> retention period(s).
> Since there seems to be a fair number of serious zfs users here, I was
> hoping for some further suggestions for use in either case. Any input is
> welcome...
> Thanks,
> Charles
> [1] - http://people.freebsd.org/~rse/snapshot/
> [2] - http://www.scottlu.com/Content/Snapfilter.html

More information about the freebsd-fs mailing list