Subject: du ouput query
To: None <port-i386@netbsd.org>
From: Ray Phillips <r.phillips@jkmrc.com>
List: port-i386
Date: 07/30/2007 17:20:38
I copied a directory to another machine using rsync over SSH:

$ rsync -e ssh --archive --progress --verbose /var/spool/MD-Bayes/DB \
>                                192.168.37.87:/var/spool/MD-Bayes

I thought I'd test the result by tar'ing up the source directory, 
ftp'ing it to the target machine, untarring it and using `diff -r' to 
compare that with the rsync copy.

`diff -r' said there were no differences, but `du -sh' said the 
rsync'ed copy was 425 MB in size while the untarred one was 356 MB.

I compared the results of `ls -lR' for both directories and found no 
differences.

Running `du -sh *' in the top level of the two copies gave different 
values for many of the subdirectories.  I moved two of the 
bottom-level subdirectories into the one place for comparison:

$ ls -l
total 8
drwx------  2 defang  wheel  512 Jul 30 10:28 dir1
drwx------  2 defang  wheel  512 Jul 30 10:28 dir2
$ du -sh *
1.1M    dir1
1.3M    dir2
$ ls -la dir1
total 2184
drwx------  2 defang  wheel      512 Jul 30 10:28 .
drwxr-xr-x  4 defang  wheel      512 Jul 30 16:46 ..
-rw-r-----  1 defang  wheel  1310720 Jul 30 10:28 alister.db
$ ls -la dir2
total 2600
drwx------  2 defang  wheel      512 Jul 30 10:28 .
drwxr-xr-x  4 defang  wheel      512 Jul 30 16:46 ..
-rw-r-----  1 defang  wheel  1310720 Jul 30 10:28 alister.db
$

Could you explain why du thinks these directories have different sizes please?

(This machine is running NetBSD 3.99.20 (GENERIC) built from sources 
CVS-updated in May 2006.)


Ray