From toasty@home.dragondata.com  Fri Feb 27 23:11:41 1998
Received: from home.dragondata.com (root@home.dragondata.com [204.137.237.2])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA04071
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 27 Feb 1998 23:11:40 -0800 (PST)
          (envelope-from toasty@home.dragondata.com)
Received: (from toasty@localhost)
	by home.dragondata.com (8.8.8/8.8.5) id NAA19436;
	Fri, 27 Feb 1998 13:39:44 -0600 (CST)
Message-Id: <199802271939.NAA19436@home.dragondata.com>
Date: Fri, 27 Feb 1998 13:39:44 -0600 (CST)
From: toasty@dragondata.com
Reply-To: toasty@dragondata.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: df(1) gives values over 100%
X-Send-Pr-Version: 3.2

>Number:         5870
>Category:       bin
>Synopsis:       df(1) gives values over 100%
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 27 23:20:01 PST 1998
>Closed-Date:    Fri Feb 27 23:51:05 PST 1998
>Last-Modified:  Wed Mar 11 08:50:01 PST 1998
>Originator:     Kevin Day
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
DragonData
>Environment:

-current system, cvsupped on Feb 5th.

>Description:

df(1) will give usage values over 100%

Filesystem  1K-blocks     Used    Avail Capacity iused   ifree  %iused  Mounted on
/dev/wd0a      127023    19946    96916    17%    1256   30486     4%   /
/dev/wd0s1h    347295    42755   276757    13%    1494   85800     2%   /userland
/dev/wd0s1g     63503      759    57664     1%     145   15725     1%   /userland/var
/dev/wd0s1d   2991318   169969  2582044     6%   18308  729530     2%   /userland/home
/dev/wd0s1f    198399   196536   -14008   108%   50174       0   100%   /usr
/dev/wd0s1e    127023     1469   115393     1%     195   31547     1%   /var
procfs              4        4        0   100%      29    4087     1%   /proc
procfs              4        4        0   100%      29    4087     1%   /userland/proc

Somehow, 198399 - 196536 is ending up a negative number.

This wouldn't be severe if I didn't have progams that used the output of df
for monitoring.


>How-To-Repeat:

Run out of inodes, then do a df.

>Fix:
	
Unknown.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jmg 
State-Changed-When: Fri Feb 27 23:51:05 PST 1998 
State-Changed-Why:  
this is actually normal behavior for ffs filesystems...  they reserve 
part of the space for optimization on storing the files... 

if you notice: 
169969 + 2582044 = 2752013 and not 2991318 as the total says...  it 
prevents a user from using all the disk space and then the root user 
not being able to do anything about it... 

From: Martin Cracauer <cracauer@cons.org>
To: toasty@dragondata.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/5870: df(1) gives values over 100%
Date: Wed, 11 Mar 1998 17:40:28 +0100

 In <199802271939.NAA19436@home.dragondata.com>, toasty@dragondata.com wrote: 
 [...]
 > Filesystem  1K-blocks     Used    Avail Capacity iused   ifree  %iused  Mounted on
 > /dev/wd0a      127023    19946    96916    17%    1256   30486     4%   /
 > /dev/wd0s1h    347295    42755   276757    13%    1494   85800     2%   /userland
 > /dev/wd0s1g     63503      759    57664     1%     145   15725     1%   /userland/var
 > /dev/wd0s1d   2991318   169969  2582044     6%   18308  729530     2%   /userland/home
 > /dev/wd0s1f    198399   196536   -14008   108%   50174       0   100%   /usr
 > /dev/wd0s1e    127023     1469   115393     1%     195   31547     1%   /var
 > procfs              4        4        0   100%      29    4087     1%   /proc
 > procfs              4        4        0   100%      29    4087     1%   /userland/proc
 > 
 > Somehow, 198399 - 196536 is ending up a negative number.
 
 You did not take into account that a certain amount of filesystem
 space (by default 10%) is reserved  to be used only by root.
 
 If you look at the other lines, you'll notice that User+Avail !=
 1k-blocks. "Avail" is what is available for non-root users.
 
 Hope this helps
 	Martin
 -- 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer/
 BSD User Group Hamburg/Germany      http://www.bsdhh.org/
>Unformatted:
Kevin Day
