File size discrepancies

Modulok modulok at gmail.com
Sat Sep 29 08:00:43 PDT 2007


> du doesn't count in bytes; it counts in disk blocks or KB.  A 12KB
> difference is probably just due to better packing of directories in
> your newly-created tree as compared to your orignal one.  To figure out
> where the difference is, run "du -a" in both trees and diff the two
> outputs.

What I did to try and track down the problem:

du -a ./dirA | sort -n > dirA.tmp;
du -a ./dirB | sort -n > dirB.tmp;
diff dirA.tmp dirB.tmp;

# Exerp of the diff output:
< 554372        ./images
> 554362        ./images

< 17007468     ./video
 > 17007466     ./video

The size discrepancy is the size of the directories, not the files
contained within those directories. To be sure I ran:

diff -r dirA/images dirB/images;

There appears to be no difference in the contents.

>du doesn't count in bytes; it counts in disk blocks or KB.  A 12KB
>difference is probably just due to better packing of directories in
>your newly-created tree as compared to your orignal one.

So, the size of a directory itself can differ when the contents is
identical? This is news to me.

Thanks.
-Modulok-


More information about the freebsd-questions mailing list