du counting hardlinks towards filesize?
Solution 1:
Hardlinks are real references to the same file (represented by its inode). There is no difference between the "original" file and a hard link pointing to it as well. Both files have the same status, both are then references to this file. Removing one of them lets the other stay intact. Only removing the last hardlink will remove the file at last and free the disk space.
So if you ask du
what it sees in one directory only, it does not care that there are hardlinks elsewhere pointing to the same contents. It simply counts all the files' sizes and sums them up. Only hardlinks within the considered directory are not counted more than once. du
is that clever (not all programs necessarily need to be).
So in effect, directory A might have a du
size of 28G, directory B might have a size of 29G, but together they still only occupy 30G and if you ask du
of the size of A and B, you will get that number.
Solution 2:
And with the switch "-l" du counts the hardlinks in every subdir too, so I can see, how big the whole backup is, not only the increment delta.