Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2001 11:31:10 -0400
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        "Edward Gess" <edward_gess@hotmail.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: mysterious output of "df" utility...
Message-ID:  <01102011311000.05510@i8k.babbleon.org>
In-Reply-To: <F240ZvYzPBpB7MsLuvj0000c1be@hotmail.com>
References:  <F240ZvYzPBpB7MsLuvj0000c1be@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Well, how much less is it?

It should be something like 8% less, since the "maximum" space per df is the 
maximum user space, ignoring the space reserved for root only.  Thus, if you 
run (as root) a job like "cat /dev/zero > foo" and wait until it halts 
because the entire partition is filled up, df will tell you that the 
partition is 108% filled.  (See the -m option under newfs.)  This is what 
accounts for the fact that Used + AVail < Size.  And the Capacity is 
calculated as

  Used / Size * user-space-percentage ; normally that's  Used / (0.92 * Size)

(Incidentally, Linux does exactly the same thing, although I believe it has a 
somewhat smaller default reserved-space percentage.)

Another factor is that when it comes to disk space, sometimes "Meg" means 
1,000 x 1000 = 1,000,000 and sometimes it means 1024 * 1024 = 1048576.  This 
set things off by another 5% or so; that is, if you allocate 1 decimal meg, 
that's really only 0.952 binary meg.

If both of these factors are working against you, you could have about 13% 
less space than you'd expect.

However, if the space is *grossly* smaller than what you think you allocated, 
then something else is going on.  For example, if you have less than half the 
space you'd expect, perhaps you allocated n 512-byte sectors when meant to 
allocate n K (1024 bytes).

On Saturday 20 October 2001 11:14, Edward Gess wrote:
>   Hello,
>   When I am using "df" utility to find out my disk usage info., I am
> getting stange output, i.e. the size is much smaller that should be!
>   For example: during FreeBSD installation I gave for my root ("/") slice
>   50MB after installation with "df" utility I am getting that my root slice
>   is < 50MB!!! Why??? More to that, when comparing "Used" and "Avail"
> fields,
>   there much confusing thing! Logically the sum of "Used" and "Avail" must
> be
>   equal to size of the slice, but it is much smaller than 50MB!!!
>   If I would set "S" as a "Size" field of "df -h" output, "U" - "Used" and
>   "A" - "Avail", so "S" is < than size of slice I've chosen during install.
>   and "U" + "A" is < that "S", so I am loosing my free space!!! Please
> explain me
>   this mysterious understanding of my space by "df" utility...
>   Thanks.
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

-- 
Brian T. Schellenberger . . . . . . .   bts@wnt.sas.com (work)
Brian, the man from Babble-On . . . .   bts@babbleon.org (personal)
                                        http://www.babbleon.org

-------> Free Dmitry Sklyarov!  (let him go home)  <-----------

http://www.eff.org                 http://www.programming-freedom.org 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01102011311000.05510>