[Ocfs2-users] Different size with du and ls
Markus Meyer
markus.meyer at koeln.de
Thu Jul 10 03:53:35 PDT 2008
Hi all,
I stumbled over a curious thing. The Linux tools "df" and "du" aren't
working correctly on an OCFS2 filesystem. "df" shows approx. twice the
size as there is on the volume.
Here how I found out about this issue:
- same dir(a few files more in OCFS but the files are ca. 12 kB in
size), first on XFS second on the OCFS volume
# du -ms /mnt/user/small/kl/
439 /mnt/user/small/kl/
# du -ms ~wkw/data/user/small/kl/
27 /web/wkw/data/user/small/kl/
- file size on OCFS2
# du -ks /mnt/user/small/11/11zzzzwa1.jpg
64 11zzzzwa1.jpg
# ls -lh /mnt/user/small/11/11zzzzwa1.jpg
2,4K 11zzzzwa1.jpg
- same file on XFS
# ls -lh /data/user/small/11/11zzzzwa1.jpg
2,4K /data/user/small/11/11zzzzwa1.jpg
# md5sum ~wkw/data/user/small/11/11zzzzwa1.jpg
d49c626360a37de9134ddc0ed31b1f59 /web/wkw/data/user/small/11/11zzzzwa1.jpg
# md5sum /mnt/user/small/11/11zzzzwa1.jpg
d49c626360a37de9134ddc0ed31b1f59 11zzzzwa1.jpg
Following versions we use:
Kernel: Vanilla Debian Kernel 2.6.25-2-amd64
# modinfo ocfs2
description: OCFS2 1.5.0
version: 1.5.0
vermagic: 2.6.25-2-amd64 SMP mod_unload
# dpkg -s ocfs2-tools | grep ^Vers
Version: 1.2.4-1.2
The OCFS2 has been created with "-T mail -N 2".
Can anyone explain why there is this big difference between "du" and
"ls"? Currently we can't rely on "df/du" to give us correct information
about the disk usage. Maybe this problem is with the "df" version so I
post the version number here too:
# dpkg -s coreutils | grep ^Vers
Version: 5.97-5.3
Regards,
Markus Meyer
More information about the Ocfs2-users
mailing list