(rsync on) mounted volume: hard links seem to be preserved, but space calculated as full files
Solution 1:
My version of du
(Debian, du (GNU coreutils) 8.30
) handles files with hardlinks and counts the multiple instances only once. It would appear that yours does not. You can verify this fairly easily, though
Prepare the scenario
mkdir zzz # Scenario workspace
tar cf zzz/etc.1 /etc # Ignore "tar: Removing leading `/' from member names"
Trial #1. Two files copied but not hardlinked
cp zzz/etc.1 zzz/etc.2 # Create copy
du -s zzz/etc.1 # 2580 KB, in my instance
du -s zzz/etc.2 # As you would expect, the same value
du -s zzz # 5164 KB, because the files are "different"
Trial #2. Two files hardlinked together
rm zzz/etc.2
ln zzz/etc.1 zzz/etc.2 # Create hardlink
du -s zzz/etc.1 # Unchanged from above, of course, 2850 KB
du -s zzz/etc.2 # As you would expect, still the same value
du -s zzz # For me, this is still the same value, 2580 KB
If your instance of du
cannot handle multiple instances of the same hardlinked file, your trial #2 will return the total of both etc.1
and etc.2
just like it did for trial #1.
Using this information you can determine whether your version of du
is being misleading, or that the files really are using up more disk space that you would expect. (Given your other metrics I'm fairly sure it's the former.)