SUMMARY: how to find minfree on a FS

From: Sanjay Kumar (sanjayk@sdt.com)
Date: Wed Oct 18 1995 - 01:47:53 CDT


-

THANKS GURUS,

                I received an overwhelming response for my original question on finding the value of "minfree" for an existing FS.

Original Question

> I'm looking for a way to find out value of "minfree" (file system parameter, which controls the minimum amount of disk percentage to be reserved to
> administrative purpose (only accessable by PID 0), by default it is 10%). I however know how to change it, by using "tunefs", but the big question here is to
> know the current value, we know it is not default (10%) anymore.
>
> SYSTEM:
> ss1000/sun4d running Solaris 2.4.
>
>

THE ANSWER:

In a way all the answers are correct, it is the point of view of course. But unfortunately "dumpfs" doesn't work for Solaris 2.4.

What worked for me was

/usr/sbin/fstyp -v <raw device> | grep minfree

THANKS A TON AGAIN FOR ALL THOSE YOU READ/THOUGHT AND RESPONDED

Sanjay Kumar

sanjayk@sdt.com

----------------------------------------------------------------------------------

try dumpfs Rainer Leberle rleberle@Auspex.de

------------------------------------------------------------
you can use "adb" to query the running kernel, like this:
(as root)

adb -k /dev/ksyms /dev/mem
   -this'll return something like:
physmem 1fd74
   -now, type:
minfree/D
   -to see the value of minfree expressed in (D)ecimal. The system responds:
minfree:
minfree: 64
   -To exit adb, type:
$q

You can check the running kernel for the value of pretty much any kernel
parameter in the same fashion.

Scott McBain scottm@lynden.com

( I don't think minfree(FS) is a kernel parameter, the parameter (minfree) kernel keeps is the one which is the minimam amount of memory free before paging
kicks in, which is diffrernt from a file system minfree. Correct me/kick me if I am wrong.)

---------------------------------------------------------------------------

I don't know about Solaris, but
SunOS has dumpfs command:

% dumpfs /dev/sd0a | head
magic 11954 format dynamic time Mon Oct 16 22:50:53 1995
nbfree 719 ndir 98 nifree 4079 nffree 233
ncg 2 ncyl 30 size 10800 blocks 10079
bsize 8192 shift 13 mask 0xffffe000
fsize 1024 shift 10 mask 0xfffffc00
frag 8 shift 3 fsbtodb 1
minfree 10% optim time maxcontig 7 maxbpg 2048
rotdelay 0ms rps 73
ntrak 9 nsect 80 npsect 80 spc 720
trackskew 0 interleave 1

Mattias Zhabinskiy

---------------------------------------------------------------------------

/usr/sbin/fstyp -v <raw device>
Paul Hocking

-----------------------------------------------------------------------------

I don't know if there is an "easy" command that gives the answer
directly. Also I don't know if it is the same with Solaris. With SunOS
4.1.3 if possible I use tunefs itself. eg.
     tunefs -m 5 /usr1
and the system replies with:
minimum percentage of free space changes from 10% to 5%
which tells me what it was before (and I can put it back if I want to).

I say "if possible" above because I am not sure that it is a good idea to
do this to a mounted file system that others may be using. If in doubt I
calculate the answer from df eg.

percentage free space = (kbytes - used - avail) * 100 / kbytes

Hope this helps

Richard Butler

------------------------------------------------------------------------------

Don't know 2.x, but in 1.x, it's dumpfs.

Regards,

J. Bern

-------------------------------------------------------------------------------

Under SunOS4 you could:

        dumpfs <device> | grep '^minfree'

Under SunOS5 I do not know the equivalent but you can get very close to
the truth (SunOS4 or SunOS5) by looking at the output of `df -k`:

minfree is approximately: kbytes - used - avail x 100 %
                                ---------------------
                                   kbytes
Peter Hesse

------------------------------------------------------------------------------

Two ways; both amount to the same thing.
==================================================================
        $ df -k /
        Filesystem kbytes used avail capacity Mounted on
        /dev/dsk/c0t3d0s0 38383 22746 11807 66% /
        $

Add the 'used' and 'avail' then divide by 'kbytes' then subtract from 1.0.
1.0 - ( ( 22746 + 11807) / 38383 ) = 0.0998 = about 10 percent
==================================================================

The other way involves the statvfs() system call. Once you get the
struct, the calculation is:
        1.0 - ( (( f_blocks - f_bfree) + f_bavail ) / f_blocks )

The only difference is that statvfs() does not tell you the 'used' value
directly, you get it by subtracting f_bfree from f_blocks.

A simpler way:

Use the fstyp command.

        rocky# fstyp -v /dev/dsk/c0t3d0s0
        ufs
        magic 11954 format dynamic time Tue Oct 17 09:35:27 1995
        sblkno 16 cblkno 24 iblkno 32 dblkno 504
        sbsize 2048 cgsize 2048 cgoffset 40 cgmask 0xfffffff0
        ncg 6 size 41328 blocks 38383
        bsize 8192 shift 13 mask 0xffffe000
        fsize 1024 shift 10 mask 0xfffffc00
        frag 8 shift 3 fsbtodb 1
here => minfree 10% maxbpg 2048 optim time
        maxcontig 7 rotdelay 0ms rps 90

Adam Nevins

------------------------------------------------------------------------------

# mkfs -m /dev/dsk/c1t4d0s2

Anchi

--------------------------------------------------------------------------------

--- End of forwarded mail from "Sanjay Kumar" <sanjayk>

--
 ___________________________________________________________________________

Sanjay Kumar Sabre Decision Technologies MD 4075 PO Box 619616 Dallas/Fort Worth Airport TX 75261 Tel: (817) 931-3389 FAX: (817) 967-9763 E-mail: sanjayk@sdt.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:34 CDT