From owner-freebsd-questions@FreeBSD.ORG Fri Dec 23 00:28:28 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A370316A41F for ; Fri, 23 Dec 2005 00:28:28 +0000 (GMT) (envelope-from parv@pair.com) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9DE343D5E for ; Fri, 23 Dec 2005 00:28:26 +0000 (GMT) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([68.67.248.52]) by mta11.adelphia.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051223002826.NPMI5278.mta11.adelphia.net@default.chvlva.adelphia.net>; Thu, 22 Dec 2005 19:28:26 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id E9EBFB5A0; Thu, 22 Dec 2005 19:28:26 -0500 (EST) Date: Thu, 22 Dec 2005 19:28:26 -0500 From: Parv To: Tim Lastine Message-ID: <20051223002826.GA40026@holestein.holy.cow> Mail-Followup-To: Tim Lastine , freebsd-questions@freebsd.org References: <7.0.0.16.0.20051222100521.01ed28d8@smig.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7.0.0.16.0.20051222100521.01ed28d8@smig.net> Cc: freebsd-questions@freebsd.org Subject: Re: Inconsistencies in df X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2005 00:28:28 -0000 in message <7.0.0.16.0.20051222100521.01ed28d8@smig.net>, wrote Tim Lastine thusly... > > We are wondering why df gives such peculiar outputs on large disk > drives? The used space and the available space do not add up the > reported size of the partition. Is this a problem, or is it just the > way it is? We are using a 250 Gig SATA (ad4) drive and a 1000 Gig > SATA Raid 0(da0) drive ... > canicula-a# df -h > Filesystem Size Used Avail Capacity Mounted on > /dev/ad4s1a 2.9G 55M 2.6G 2% / ... > canicula-a# df > Filesystem 1K-blocks Used Avail Capacity Mounted on > /dev/ad4s1a 3049102 56150 2749024 2% / ... > /dev/ad4s1f 64489864 4 59330672 0% /opt > /dev/da0s1d 949613700 4 873644600 0% /raid > /dev/ad4s1e 4058062 29730 2903688 22% /usr > /dev/ad4s1d 3045006 302 2801104 0% /var (Tabs were evil in the above case as df outputs were not lined up correctly; i have readjusted the above.) Try to take 8% reserve in account ... df -t ufs \ | tail +2 \ | awk ' { sum = $3 + $4 + $2 * 0.08 ; printf "%s: space diff: %f\n" , $1 , $2 - sum } ' ... subject to rounding errors. Here is an example ... # df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad0s2a 138606 51952 75566 41% / devfs 1 1 0 100% /dev /dev/ad0s2d 594926 417042 130290 76% /usr /dev/ad0s2e 475886 95826 341990 22% /var /dev/ad0s2g 16724102 11949534 3436640 78% /misc /dev/ad0s2f 2875822 16170 2629588 1% /work procfs 4 4 0 100% /proc # df -t ufs | tail +2 | awk '{ ... }' # awk program is given above /dev/ad0s2a: space diff: -0.480000 /dev/ad0s2d: space diff: -0.080000 /dev/ad0s2e: space diff: -0.880000 /dev/ad0s2g: space diff: -0.160000 /dev/ad0s2f: space diff: -1.760000 - Parv --