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

Wed Mar 11 22:00:52 UTC 2009
Rob Kampen <rkampen at kampensonline.com>


Nicolas Thierry-Mieg wrote:
> Filipe Brandenburger wrote:
>   
>> Hello,
>>
>> I noticed something unusual today.
>>
>> If I "du" a small file (couple of bytes) in CentOS 5, it tells me the
>> file is using 8kb, while I was expecting 4kb which is the block size
>> I'm using.
>>
>> I tried this on several CentOS 5 machines, both x86_64 and i386:
>>
>> $ 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.
>
> HTH
>   
I did the same test but my du -h test.txt gives
8.0K    test.txt
I am running linux mirrored drives, thus in one respect it is actually 
using 2 times 4.0K - once per drive??
Rob
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rkampen.vcf
Type: text/x-vcard
Size: 121 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20090311/bd34b5f9/attachment-0005.vcf>