Summary: df -k : discrepancy in the % displayed

From: Ramesh Pathak <ramesh.pathak_at_vinciti.com>
Date: Wed Aug 27 2003 - 19:33:46 EDT
Let me thank all the great guys who responded to my query so fast.
Here are the excerpts from the mails that I received.
The reason is "minfree" taking some bytes out from the user.
And Paul also suggests that fragmentation may add to it further.

Thanks to all of you,
Ramesh

Michael Schulte
===========
The standard file system reserves about 10% of the kbytes for efficiency; it
   is unavailable to anyone except root.  Notice that the used+avail !=
kbytes.

VAleriy
========
If you created your filesystem with default options, 10% of the space
was reserved for root only access. So, in reality, you have to divide it
by (0.9*963869), i.e.
963869kb available total, take 10% for root only writes and you'll get
867462.1, now  185680/867462.1 = 21%
see man newfs section for -m option

Tom Payerle
=========
On Unix filesystems, there is typically some portion of a filesystem which
is reserved for root only; i.e. once a filesystem is filled to a certain
point,
only root can write to it.  This is useful for stuff like / and /usr to
enable
things to work pretty well even when filesystems get "full".  I think the
mkfs/newfs commands default to about 5% for this root reservation.  Some
systems (I forget whether Solaris has this) have tunefs type commands that
can alter it once the filesystem is up and running, others it must be done
at creation time.

In your root case,
used (185680) + avail (720357) = 906037 or 57832 less than in kbytes field.
(which is 6% of the total).

Note that 185680/906037 = 20.5%

This 5% or so reservation is probably not worth bothering with on a 1-2GB
system disk or partitions (/, /usr, /var, etc).  It probably is worth messing
with when dealing with 10 GB or more data only partitions (e.g. the system
can function pretty well if partition was missing), although to be honest
even in those cases I usually haven't done anything about it.
Tom Payerle
Dept of Physics payerle@physics.umd.edu
University of Maryland (301) 405-6973
College Park, MD 20742-4111 Fax: (301) 314-9525
ID16314 Explanation of file system usage as reported by df and fsck

Paul Richards
==============
:df output
:   Filesystem            kbytes    used   avail capacity ...
:/dev/sd2d            1961966 1745945   19825    99%   ...

:1961966 kbytesFile system size
:1745945kbytes usedAmount used
:19825 kbytes freeEqual to (size less minfree%) less used
:99%Equal to used as % of (size less minfree%)

so minfree can affect the answer
also fragmentation can have an effect

:For example, in a file system that creates predominantly 5k files on an
:8k block size there will be many 3k frags free and never used. In the
:extreme case this would result in a file system that is effectively
:full despite only 5/8 of the filesystem being used.

Jay Lessert
========
minfree.

Looks like / was built with 6% minfree and /usr with 2% minfree.

/: 185680/(0.94 * 963869) = 20.5%
/: 2263070/(0.98 * 3099093) = 74.51%

You can see current minfree (and lots of other interesting information
about a file system with:

% sudo fstyp -v /dev/rdsk/c0t0d0s0


Crist J. Clark
========

Read df(1),

     -k    Print the allocation in kbytes. The output consists of
           one  line  of information for each specified file sys-
           tem. This information includes the file  system  name,
           the  total  space  allocated  in  the file system, the
           amount of space allocated to existing files, the total
           amount  of  space  available  for  the creation of new
           files by unpriviledged users, and  the  percentage  of
                    ^^^^^^^^^^^^^
           normally  available  space that is currently allocated
           to all files on the file system. This option overrides
           the -b, -e, -n, and -t options.


And newfs(1M),

           -m free
                 The minimum percentage of free space to maintain
                 in   the   file  system  (between  1%  and  99%,
                 inclusively). This space is off-limits to normal
                 users.  Once  the  file system is filled to this
                 threshold,  only  the  super-user  can  continue
                 writing  to  the file system. This parameter can
                 be subsequently  changed  using  the  tunefs(1M)
                 command.

                 The default is  ((64  Mbytes/partition  size)  *
                 100),  rounded  down  to the nearest integer and
                 limited between 1% and 10%, inclusively.



Lars
====
man newfs(1m), -m option.

 capacity = used / ( used + avail )

 used + avail < kbytes.


--
Omnibiblious, adj.:
        Indifferent to type of drink.  "Oh, you can get me anything.
I'm omnibiblious."

Eugene
=========
Hi

By default a certain amount of space is allocated as "reserved for root use
only". This space is also commonly referred to as "slosh space".

This can be modified with tunefs (see man page).

The calculation takes this into account. Typically this is between 1 and 10
%, depending on the FS size.


-----Original Message-----
The % available is based on the 90% level of capacity:

/: ( 185680 / (.90 * 963869)) = 21%


Mark
==========
thats because when you do a defualt newfs it save 10% for superuser.. man
newfs and look for the -m option:

          -m free        The minimum percentage of free space  to
                         maintain in the file system.  This space
                         is off-limits to normal users.  Once the
                         file system is filled to this threshold,
                         only the super-user can continue writing
                         to  the file system.  This parameter can
                         be  subsequently   changed   using   the
                         tunefs(1M) command.  The default is 10%.

So with a newfs -m 3 /dev/dsk/c0t0d0s0 will give you 7% more disk space
for that partition...

Hope this helps...

Kevin
=====

     The capacity percentage reported by "df -k" is the amount of user
writable space that is in use.  What you're calculating is the total
amount of space that is in use.  By default, UFS filesystems reserve 10%
of the space in the filesystem that can only be written to by root (as an
aside, this can and should be changed when large filesystems are created;
10% of a 1 TB filesystem is a lot of wasted space).  This is also why you
can see filesystems that are more than 100% full.  HTH...

==================================

Kevin Buterbaugh - Systems Engineer
LifeWay - www.lifeway.com
Man tunefs
Look at the -m Option and it was clearer ;-)


--
Michael Schneider                               MM-ITconsulting
Sun Certified Network Administrator    Ph: +49(0)700






Ramesh C Pathak
Vinciti Networks Pvt. Ltd.,
#1109, 24th Main Road,
JP Nagar 1st Phase,
Bangalore - 560 078

Ph: +91-80-6556830
Fax: +91-80-6556820

email: ramesh.pathak@vinciti.com
URL: http://www.vinciti.com

This information is intended only for the use of the individual to whom it
is addressed and may contain information that is privileged, confidential
and exempt from disclosure under law. If you are not the intended recipient,
you are hereby notified that any use, dissemination, distribution or copying
of this communication is strictly prohibited.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Wed Aug 27 19:33:08 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:18 EST