Make ZFS auto-destroy snapshots when the out of space?
kirk at strauser.com
Sun May 30 22:16:28 UTC 2010
On May 30, 2010, at 12:27 AM, Xin LI wrote:
> I think this sounds like a good idea but I think we may probably want
> to explore a more general mechanism, e.g. a daemon that "listen"s
> system events like file system full, etc. and execute some user
> defined actions.
I could definitely get on board with that, and I think such a
mechanism would be generally useful even without my idea. I wouldn't
mind having a mechanism to send me an IM whenever I need to respond to
> One thing that we want to avoid is that by making the "automatic
> recycle" we would open a new race between system and user backup
> programs, i.e. if you remove an intermediate snapshot, 'zfs send' may
> fail at receiving side, if incremental send is being used. We would
> need a way to "notify" that a 'zfs send' is underway.
Well, two things about that: first, if I were implementing it in a
vacuum without any input from anyone else, I'd make it simply delete
the oldest snapshot. There's precedence in OS X's Time Machine, and
that's probably what most people would want and expect anyway.
Second, I'd treat those almost as "property" of the OS. While there's
nothing magical about them, they're created (and subject to deletion)
at the whim of the system, and you shouldn't be sending or receiving
them or doing anything else that assumes their integrity. You could
still create and destroy your own snapshots as needed, but the OS
would manage these on its own.
Again, this is how I would handle it in a vacuum if I didn't know or
care how anyone else wanted to use it. Still, I think those might be
More information about the freebsd-stable