From owner-freebsd-stable@FreeBSD.ORG Sun May 30 22:03:47 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 7316A106564A for ; Sun, 30 May 2010 22:03:47 +0000 (UTC) (envelope-from kirk@strauser.com) Received: from kanga.honeypot.net (kanga.honeypot.net [IPv6:2001:470:a80a:1:21f:d0ff:fe22:b8a8]) by mx1.freebsd.org (Postfix) with ESMTP id 155E48FC14 for ; Sun, 30 May 2010 22:03:47 +0000 (UTC) Received: from kanga.honeypot.net (localhost [127.0.0.1]) by kanga.honeypot.net (Postfix) with ESMTP id A0BC87BE53; Sun, 30 May 2010 17:03:46 -0500 (CDT) X-Virus-Scanned: amavisd-new at honeypot.net Received: from kanga.honeypot.net ([127.0.0.1]) by kanga.honeypot.net (kanga.honeypot.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id E28xMtiGzgNb; Sun, 30 May 2010 17:03:44 -0500 (CDT) Received: from pooh.honeypot.net (pooh.honeypot.net [IPv6:2001:470:a80a:1:20a:95ff:fed5:10f2]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by kanga.honeypot.net (Postfix) with ESMTPSA id 7CAC07BE4B; Sun, 30 May 2010 17:03:44 -0500 (CDT) Message-Id: From: Kirk Strauser To: Garrett Cooper In-Reply-To: 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 17:03:43 -0500 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: Sun, 30 May 2010 22:03:47 -0000 On May 29, 2010, at 9:58 PM, Garrett Cooper wrote: > So basically you're saying deal with an LRU snapshot deletion when you > reach a certain threshold of free space, type scheme? This might get > tricky, but it does lend itself to other systems I suppose (I hate to > mention it, but the best one I can think of is Windows' system > restore... there might be something else available with OSX's Time > Machine). Time Machine works almost exactly that way. It stores as far back in history as you have hard drive space to hold it. > What would be more tricky is when the automated system is filling in a > bunch of useless snapshots unnecessarily, but as you'd be providing > the snapshot criteria, I suppose that you would know what snapshots > you want to save and what ones you want to toss... I don't think add any trickery. The snapshots are again analogous to how Time Machine works, where you have hourly snapshots, then a week's worth of daily, then a month's worth of weeklies, then as many monthly snapshots as will fit on your hard drive. If you run out of space, delete November, then December. > It's an interesting thought though -- just increases the overall > complexity of the system and may only meet one need. I think the additional complexity would amount to adding a config option to the code that gets run when a disk is full that executes an arbitrary command, namely a user-space shell script that deletes the oldest automatically-generated snapshot. The "only one need" that it addresses is that now FreeBSD would come with a built-in recovery system. Did a "make installworld" but screwed something up and ended up with a non-bootable system? Pop in a recovery CD and revert to the "4 hours ago" snapshot, then reboot. Voila! It never happened. Accidentally deleted /etc/passwd? Retrieve the version from /.zfs/snapshot/weekly-2010-21/etc/passwd . Just realized that you deleted an important file 3 months ago and only keep 2 weeks worth of backups? No problem, as long as you haven't filled up your hard drive since then. -- Kirk Strauser