Can somebody explain this? du & ls showing different sizes

Vijay Gill vijay.s.gill at gmail.com
Sun Feb 15 20:05:21 UTC 2009


Hi

I just came across this issue on my server at home which complained
about the lack of space which I knew was wrong. It was supposed to
have atleast 3.5 gig free. On investigating I found that there a few
lines showing the following behaviour.

Running du -h tells that the file occupies 512M but ls -l tells that
the file is a lot smaller. Also I am sure the the cluster size is not
512M (or am I wrong there?).

I have provided the relevant information from fstab, du, ls and uname
and if more info is needed, I can provide that too. But is there a
solution to this problem?

Vijay


/dev/sda2       /               xfs
noatime,nodiratime,async,allocsize=1M,noikeep   0 0


[root at aria ~]# du -sh /var/log/httpd/* | grep M
512M    /var/log/httpd/webserver-access_log

[root at aria ~]# ls -l /var/log/httpd/webserver-access_log
-rw-r--r-- 1 root root 2884214 2009-02-15 16:18
/var/log/httpd/webserver-access_log

[root at aria ~]# xfs_info  /dev/sda2
meta-data=/dev/root              isize=256    agcount=4, agsize=524121 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=2096482, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0


[root at aria ~]# uname -a
Linux aria 2.6.27.12-170.2.5.fc10.i686 #1 SMP Wed Jan 21 02:09:37 EST
2009 i686 athlon i386 GNU/Linux




More information about the fedora-list mailing list