[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: df
From: |
Bob Proulx |
Subject: |
Re: df |
Date: |
Wed, 29 Oct 2003 09:34:58 -0700 |
User-agent: |
Mutt/1.3.28i |
Frédéric Robinet wrote:
> after a df on my Debian, I have this:
>
> Venus:/recup# df -h
> Filesystem Size Used Avail Use% Mounted on
> /dev/sda1 15G 610M 14G 5% /
> /dev/sdb1 68G 3.5G 61G 6% /var2
> Venus:/recup#
>
> 68G - 3.5G = 61G ???
When the filesystem is created 5%-10% of the total disk space will be
reserved by the filesystem as 'minfree'. This is available only to
root processes and not to non-root processes. The amount of minfree
is dependent upon the defaults of the particular mkfs. You probably
have 5% unless you changed it. Also some disk space will be used by
Inodes in some filesystems. On others it is dynamic.
68G - minfree - inodes - 3.5G = 61G
The df program is reporting the numbers as returned from statfs(2).
It is not calculating them as you are doing here.
man 2 statfs
struct statfs {
long f_type; /* type of filesystem (see below) */
long f_bsize; /* optimal transfer block size */
long f_blocks; /* total data blocks in file system */
long f_bfree; /* free blocks in fs */
long f_bavail; /* free blocks avail to non-superuser */
long f_files; /* total file nodes in file system */
long f_ffree; /* free file nodes in fs */
fsid_t f_fsid; /* file system id */
long f_namelen; /* maximum length of filenames */
long f_spare[6]; /* spare for later */
};
Hope that helps,
Bob
- df, Frédéric Robinet, 2003/10/29
- Re: df,
Bob Proulx <=
- Re: df, Alexandre Dulaunoy, 2003/10/29