rsync has a --hard-links
option:
-H, --hard-links
This tells rsync to look for hard-linked files in the source and
link together the corresponding files on the destination. With-
out this option, hard-linked files in the source are treated as
though they were separate files.
However, when I tried to copy hard linked files from one volumn to another, I found the hard-links are gone at destination — each of the hard-linked file have a link count of 1 (instead of >=2).
I copied hard-linked files together in a single rsync
command.
Is there anything that I'm missing or rsync
can't preserve hard links at destination?
Best Answer
It works here. As @xenoid hinted in their comment above, you never will be able to preserve hard links if the destination filesystem is, say, FAT32, or some other FS that doesn't support hard links.