Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 May 2010 20:33:40 -0400
From:      David Magda <dmagda@ee.ryerson.ca>
To:        Kirk Strauser <kirk@strauser.com>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: Make ZFS auto-destroy snapshots when the out of space?
Message-ID:  <4632C12D-2B1E-4073-B2C9-E9D15C212EF1@ee.ryerson.ca>
In-Reply-To: <4C017419.9010909@strauser.com>
References:  <4C017419.9010909@strauser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On May 29, 2010, at 16:07, Kirk Strauser wrote:

> I'd propose standardizing on an attribute like  
> org.freebsd:allowautodestroy. Modify ZFS's disk full behavior [...]   
> Also run a daily periodic script to ensure that the free space stays  
> below a configurable threshold each day so that ZFS isn't constantly  
> butting up against completely full drives.


Why not simply have a script that runs and checks for pool usage and  
then deletes snapshots with that attribute if necessary? Why do you  
need to have have it built into ZFS?

> What do you think? It seems like this should be pretty easy to  
> implement without requiring any upstream changes or new FreeBSD-only  
> data structures. The whole thing could possibly be implemented in  
> userspace, but I don't know that ZFS has any exception handling  
> callbacks that would make it easy.

IMHO this shouldn't be built into the file system. You have one script  
to automatically generate snapshots, and another to monitor usage and  
delete old ones.

This idea was talked about on zfs-discuss in 2006:

	http://mail.opensolaris.org/pipermail/zfs-discuss/2006-May/thread.html#2266

Good summary in this post:

	http://mail.opensolaris.org/pipermail/zfs-discuss/2006-May/002313.html

Generally I don't think this is the "Unix Way". I don't want my kernel  
doing stuff behind my back. If I want snapshots I'll create them  
(scripted or manual); if I want to get rid of them for whatever  
reason, I'll destroy them (scripted or manual). Either of these  
behaviours can then be controlled by an rc.conf(5) variable perhaps.

There's already an useful creation tool for OpenSolaris:

	http://src.opensolaris.org/source/xref/jds/zfs-snapshot/

There's also an auto-scrub script:

	http://blogs.sun.com/constantin/entry/new_opensolaris_zfs_auto_scrub




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4632C12D-2B1E-4073-B2C9-E9D15C212EF1>