From owner-freebsd-stable@FreeBSD.ORG Mon May 31 00:48:33 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97763106564A for ; Mon, 31 May 2010 00:48:33 +0000 (UTC) (envelope-from dmagda@ee.ryerson.ca) Received: from eccles.ee.ryerson.ca (eccles.ee.ryerson.ca [141.117.1.2]) by mx1.freebsd.org (Postfix) with ESMTP id 559948FC19 for ; Mon, 31 May 2010 00:48:32 +0000 (UTC) Received: from [192.168.1.103] (bas1-toronto09-1279534184.dsl.bell.ca [76.68.36.104]) (authenticated bits=0) by eccles.ee.ryerson.ca (8.14.4/8.14.4) with ESMTP id o4V0Xqju013232 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 30 May 2010 20:33:55 -0400 (EDT) (envelope-from dmagda@ee.ryerson.ca) Message-Id: <4632C12D-2B1E-4073-B2C9-E9D15C212EF1@ee.ryerson.ca> From: David Magda To: Kirk Strauser In-Reply-To: <4C017419.9010909@strauser.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 30 May 2010 20:33:40 -0400 References: <4C017419.9010909@strauser.com> X-Mailer: Apple Mail (2.936) Cc: FreeBSD-STABLE Mailing List Subject: Re: Make ZFS auto-destroy snapshots when the out of space? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 00:48:33 -0000 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