Different reported sizes with df and du

Thomas Preissler <[email protected]>
Newsgroups gmane.comp.gnu.fileutils.bugs
Organization InterNetX, Regensburg, Germany
Message-ID <[email protected]>
Hello,

I have encountered a strange problem with df 4.0.

df shows me that a partition is nearly full. But when I use other
programs like du or calculate it by hand, other values are shown.

I have checked this problem with the latest version: fileutils-4.1
and it is the same problem.


Showing df -h:

  host:~ # df -h
  ...
  /dev/hda5             3.8G  3.4G  162M  96% /var
  ...


Doing a du /var -sh with du 4.0:
  
  host:~ # du /var -sh
  1.8G    /var


Counting filesize by hand shows me:

  host:~ # for s in $(find /var -printf "%s\n") ; do sum=$(echo "$sum+$s" | bc); done; echo $sum
  1904892706


Yes, there are a few links, but that size doesn't matter.

Filesystem Ext2, Kernel 2.2.14.

I remember similar problems, when there is a huge amount of small
files. But this system has only 1331 files on /var/.


I appreciate your help.

TEAM INTERNETX / UnixSysAdmin
   
-- 
InterNetX GmbH, DNS Service Center    
Maxstrasse 6,   D-93047 Regensburg    
Preissler T.,      [email protected]
Tel. +49 941 595590   Fax. 5955968
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.