From owner-freebsd-fs@FreeBSD.ORG Wed Nov 15 21:14:25 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 EAEE516A416 for ; Wed, 15 Nov 2006 21:14:24 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB19C43D49 for ; Wed, 15 Nov 2006 21:14:16 +0000 (GMT) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net ([12.207.12.9]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20061115211409m9100em60le>; Wed, 15 Nov 2006 21:14:09 +0000 Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.13.8/8.13.8) with ESMTP id kAFLE7AP068532; Wed, 15 Nov 2006 15:14:07 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.13.8/8.13.8/Submit) id kAFLE27e068528; Wed, 15 Nov 2006 15:14:02 -0600 (CST) (envelope-from brooks) Date: Wed, 15 Nov 2006 15:14:01 -0600 From: Brooks Davis To: Ensel Sharon Message-ID: <20061115211401.GA68129@lor.one-eyed-alien.net> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Cc: freebsd-fs@freebsd.org 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:14:25 -0000 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 15, 2006 at 03:39:56PM -0500, Ensel Sharon wrote: >=20 > I am currently afraid of UFS2 snapshots (maybe that's rational and maybe > it's not ...) and so I am using Mike Rubel style rsync snapshots: >=20 > rm -rf day.3 > mv day.2 day.3 > mv day.1 day.2 > cp -al day.0 day.1 > rsync /source /destination/day.0 > > (note, GNU cp, the -al means copy everything with hard links) >=20 > You get the idea. Unless you're using some flags to rsync the symlinks are always being broken... [1:05pm] brooks@host (~/baz): ls -li total 4 32361971 -rw-r--r-- 1 brooks brooks 512 Nov 15 13:04 foo [1:05pm] brooks@host (~/baz): ln foo bar [1:05pm] brooks@host (~/baz): cp foo baz [1:05pm] brooks@host (~/baz): ls -li total 12 32361971 -rw-r--r-- 2 brooks brooks 512 Nov 15 13:04 bar 32361970 -rw-r--r-- 1 brooks brooks 512 Nov 15 13:05 baz 32361971 -rw-r--r-- 2 brooks brooks 512 Nov 15 13:04 foo [1:05pm] brooks@host (~/baz): rsync baz bar [1:06pm] brooks@host (~/baz): ls -li total 12 32361972 -rw-r--r-- 1 brooks brooks 512 Nov 15 13:06 bar 32361970 -rw-r--r-- 1 brooks brooks 512 Nov 15 13:05 baz 32361971 -rw-r--r-- 1 brooks brooks 512 Nov 15 13:04 foo > The question is, when I do a `du -ak` of each of the four days (day.0 - > day.3) I get roughly the same number for all of them, which is to be > expected. >=20 > However the output of `quota` for that user shows a _much_ larger number > than the `du` for each of those directories. >=20 > I would think that `quota` would show me the sum of day.0 plus (all the > total differences of day.1 - day.3) but it shows me a number _much_ larger > than that. I really can't even guess what the number it is showing me is. Quota operates on the filesystem and gives the amount of space used on the volume the directory you pass it is on. > 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. > Second, is there any way to get quota to show an accurate representation > of the users usage ? At this point you haven't established that it doesn't. -- Brooks --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFW4MZXY6L6fI4GtQRAmJPAKClciy4bVqfQkie6p9rw9Cs3CVjwQCeJu4V BmrInVhxkgk2+gD6uQ/hPOE= =IF7n -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE--