Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using rsync to sync a directory from server to localhost:

rsync -avz --delete ./Stuff user@host:/Stuff

This all works fine, but how come when I type 'du -s' in both the server and the localhost I get different numbers?

share|improve this question
have you tried to do a diff of both directories to see what the differences are? – Johnnie Dec 1 '12 at 1:01
up vote 6 down vote accepted

Possible reasons for the differing output from du -s:

  • Different file system block sizes, resulting in some files taking more space at one end or the other.
  • Some of the files may be sparse. You aren't using the --sparse option, so those would be filled in on the destination. If you were using that option it would be possible that some files which weren't actually sparse at the source became so at the destination.
  • Some of the files may be hard-linked. You aren't using the --hard-links option, so any hard linked files within the source will appear as multiple copies on the destination.

Using du --apparent-size may result in the same sizes being reported at both ends.

share|improve this answer
what do you mean by a "sparse" file? I'm not using symlinks or hardlinks, and I don't what what "block sizes" are. – chovy Dec 2 '12 at 6:18
I've added links to explanations of those concepts to my answer. – qqx Dec 2 '12 at 7:33

Unless you issue a --delete there is a chance that you have extraneous files in there. rsync won't delete by default, so the directories won't be in sync

share|improve this answer
I tried again with --delete and there was nothing to delete, but sizes are still different. – chovy Dec 1 '12 at 1:35
The other thing you could try is adding a -vv and --inplace (which will update destination files in-place) Other than that, you might want to do an ls of both the source and target directories and diff them. – Mark Cohen Dec 2 '12 at 2:55
Thanks, but the above answer seems to be what the issue is -- different block sizes (not really sure what this means). Files are the same. – chovy Dec 2 '12 at 6:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.