[CentOS] Disk usage for small files in ext3 in CentOS 5

Wed Mar 11 22:06:08 UTC 2009
Mike A. Harris <mharris at mharris.ca>

Nicolas Thierry-Mieg wrote:

>> $ echo test >test.txt
>> $ ls -l test.txt
>> -rw-rw-r-- 1 filbranden filbranden 5 Mar 11 17:24 test.txt
>> $ du -h test.txt
>> 8.0K	test.txt
> <snip>
>> I could not find any differences that would explain the behaviour.
>> Have you seen this before? Can you reproduce it on your systems? Do
>> you know how to get the CentOS 4 behaviour?
> 
> strange.
> I don't reproduce on an x86_64 centos 5 machine:
> [nthierry at localhost ~]$ echo test >test.txt
> [nthierry at localhost ~]$ ls -l test.txt
> -rw-rw-r-- 1 nthierry nthierry 5 Mar 11 22:44 test.txt
> [nthierry at localhost ~]$ du -h test.txt
> 4.0K    test.txt
> 
> I'm pretty sure I did nothing special when making the fs.

Doublecheck it with:

tune2fs -l /dev/hda1 |grep 'Block size'

Substitute your partition for /dev/hda1 above.