From owner-freebsd-fs@FreeBSD.ORG Wed Nov 15 21:34:55 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ABEB616A715 for ; Wed, 15 Nov 2006 21:34:55 +0000 (UTC) (envelope-from fbsd-fs@mawer.org) Received: from customer-domains.icp-qv1-irony11.iinet.net.au (customer-domains.icp-qv1-irony11.iinet.net.au [203.59.1.151]) by mx1.FreeBSD.org (Postfix) with ESMTP id 267D243D49 for ; Wed, 15 Nov 2006 21:34:45 +0000 (GMT) (envelope-from fbsd-fs@mawer.org) Received: from 203-206-173-235.perm.iinet.net.au (HELO [127.0.0.1]) ([203.206.173.235]) by customer-domains.icp-qv1-irony11.iinet.net.au with ESMTP; 16 Nov 2006 05:34:44 +0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALEWW0XLzq3r/2dsb2JhbAAN X-IronPort-AV: i="4.09,425,1157299200"; d="scan'208"; a="34981826:sNHT17190405" Message-ID: <455B87A0.6040604@mawer.org> Date: Thu, 16 Nov 2006 08:33:20 +1100 From: Antony Mawer User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Brooks Davis References: <20061115211401.GA68129@lor.one-eyed-alien.net> In-Reply-To: <20061115211401.GA68129@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org, Ensel Sharon Subject: Re: quota command and rsync snapshots... X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2006 21:34:55 -0000 On 16/11/2006 8:14 AM, Brooks Davis wrote: > On Wed, Nov 15, 2006 at 03:39:56PM -0500, Ensel Sharon wrote: >> So I have two questions: given a directory that contains one current >> backup and three snapshots (day.0 - day.4) what command can I run that >> will show me the total _actual_ space used ? du will not work because it >> counts up each directory as if it used all of that space... > > There isn't one that I know of. Unless the volume is only used for this > purposed (in which case df could be used) the only way to find this out > would be to write a version of du that kept track of the inode of each > hardlink and then didn't count it again. du already does this - for instance, one of our backups snapshots: $ du -h -d1 . 73G ./monthly 190M ./2006-11-06_Mon 198M ./2006-11-07_Tue 14M ./2006-11-08_Wed 19M ./2006-11-09_Thu 11M ./2006-11-10_Fri 9.6M ./2006-11-11_Sat 9.6M ./2006-11-12_Sun 15M ./2006-11-13_Mon 12M ./2006-11-14_Tue 13M ./2006-11-15_Wed 73G . The 'monthly' folder here contains several snapshots (one per month), and then there's the daily snapshots. This magic is all performed by linkchk() in /src/usr.bin/du/du.c. --Antony