[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: df and du contradict

Colonel Panic <colonel_panic_(_at_)_fnmail_(_dot_)_com> wrote:

> So I did some digging and came up with the following highly
> contradictory statements from df and du:
> bash-2.04# df -h
> Filesystem    Size   Used  Avail Capacity  Mounted on
> /dev/wd0a     503M   451M    27M    94%    /
> /dev/wd1a     213M   213M -10.6M   105%    /mnt/usr
> /dev/wd1b      36M   1.0K    35M     0%    /mnt/var
> bash-2.04# du -h -s /usr
> 193M    /usr
> bash-2.04# du -h -s /mnt/usr
> 106M    /mnt/usr

"du -h" is broken if the environment variable BLOCKSIZE is present
and set to value other than 512.  In particular, for the common
BLOCKSIZE=1k "du -h" will be off by a factor of 0.5.

I have informed the responsible parties about this some time ago,
but no fix has been committed yet.

Christian "naddy" Weisgerber                          naddy_(_at_)_mips_(_dot_)_inka_(_dot_)_de

Visit your host, monkey.org