Subject: Re: du ouput query
To: Ray Phillips <r.phillips@jkmrc.com>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: port-i386
Date: 07/30/2007 11:01:39
On Mon, Jul 30, 2007 at 05:20:38PM +1000, Ray Phillips wrote:
> 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?

Using "ls -las" gives the allocated sizes.  Probably a file
with (unallocated) holes.
-- 
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)