From owner-freebsd-stable@FreeBSD.ORG Sun Sep 7 11:30:49 2008 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 6007B1065678 for ; Sun, 7 Sep 2008 11:30:49 +0000 (UTC) (envelope-from sec+freebsdstable@42.org) Received: from ice.42.org (v6.42.org [IPv6:2001:608:9::1]) by mx1.freebsd.org (Postfix) with ESMTP id E08138FC28 for ; Sun, 7 Sep 2008 11:30:48 +0000 (UTC) (envelope-from sec+freebsdstable@42.org) Received: by ice.42.org (Postfix, from userid 1000) id A540F228F3; Sun, 7 Sep 2008 13:30:45 +0200 (CEST) Date: Sun, 7 Sep 2008 13:30:45 +0200 From: Stefan `Sec` Zehl To: freebsd-stable@freebsd.org Message-ID: <20080907113045.GA11293@ice.42.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i I-love-doing-this: really X-Modeline: vim:set ts=8 sw=4 smarttab tw=72 si noic notitle: Accept-Languages: de, en X-URL: http://sec.42.org/ Subject: snapshots and disk usage 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, 07 Sep 2008 11:30:49 -0000 Hi, I am using ufs snapshots on RELENG_7 for some time now, and am generally happy with it. I have noticed a strange behaviour when removing large amount of files, and wanted to ask if this is expected. Before starting, we check the free space on /usr: | ice:/usr>df -h . | Filesystem Size Used Avail Capacity Mounted on | /dev/ad4s2.elid 9.7G 7.6G 1.3G 64% /usr Then delete /usr/obj and run df again: | ice:/usr>sudo rm -rf obj 2>/dev/null | ice:/usr>df -h . | Filesystem Size Used Avail Capacity Mounted on | /dev/ad4s2.elid 9.7G 5.7G 3.2G 64% /usr This is unexpected. With snapshots, removing something should not release space. Sure enough, in the course of the next minute, the fake free space vanishes.... | ice:/usr>df -h . | Filesystem Size Used Avail Capacity Mounted on | /dev/ad4s2.elid 9.7G 5.9G 3.0G 66% /usr | ice:/usr>df -h . | Filesystem Size Used Avail Capacity Mounted on | /dev/ad4s2.elid 9.7G 6.6G 2.3G 74% /usr | ice:/usr>df -h . | Filesystem Size Used Avail Capacity Mounted on | /dev/ad4s2.elid 9.7G 8.6G 269M 97% /usr and all the free space is allocated in the snapshot: | ice:~>sudo snapshot list | Filesystem User User% Snap Snap% Snapshot | /usr 8GB 89.3% 2GB 21.5% daily.1 | /usr 8GB 89.3% 344MB 3.5% daily.0 | /usr 8GB 89.3% 344MB 3.5% weekly.0 | /usr 8GB 89.3% 344MB 3.5% hourly.1 | /usr 8GB 89.3% 7MB 0.1% hourly.0 My understanding so far was that df may underreport free space, but i find overreporting it a bit troublesome. -- What would happen if I tried to use that space before it was allocated to the snapshot? Case in point: I created a few unkillable hung process on /usr a few weeks ago, by running make world which was running out of diskspace, and deleting files from another windows. -- At leat thats what I think has happened. CU, Sec -- Consider the need for having to type "www.domain.name" a little IQ test that you have to take before you can access my web site.' -- Wietse