0

I know this has been asked before, but for some reason my version of rsync -H does not seem to be working consistently.

I have a backup system with lots of hard links. I want to copy the thing to a bigger disk. So I did this:

rsync -Hav /source/fotoshp /source/fotoshp-M-2 /dest

Yet, in source I have this, with the same inode:

# ls -li fotoshp-M-2/0902_aves_se/index.html fotoshp/0902_aves_se/index.html
9290102 -rw-r--r-- 14 gato gato 12042 Dec  4  2016 fotoshp/0902_aves_se/index.html
9290102 -rw-r--r-- 14 gato gato 12042 Dec  4  2016 fotoshp-M-2/0902_aves_se/index.html

while in dest I have this:

# ls -li fotoshp-M-2/0902_aves_se/index.html fotoshp/0902_aves_se/index.html
78908017 -rw-r--r-- 1 gato gato 12042 Dec  4  2016 fotoshp/0902_aves_se/index.html
79435377 -rw-r--r-- 1 gato gato 12042 Dec  4  2016 fotoshp-M-2/0902_aves_se/index.html

So, the file has been copied to another inode, destroying the hard link. The strange thing is that sometimes it works, sometimes it doesn't...

The rsync version I use is rsync-3.1.2-5.fc26.x86_64.

  • I'm not able to reproduce this with the same version of rsync on OpenBSD 6.1. – Kusalananda Sep 1 '17 at 15:25
  • Are all links in the source directory? If 13 of the 14 links above are outside the source directory there's no point in copying them. – Satō Katsura Sep 1 '17 at 15:40
  • In fact, I waited for the rsync command to finish, and for some reason at the end the hard links were preserved. However, during the sync process, rsync copied the files themselves. – Luis A. Florit Sep 1 '17 at 16:56
  • @SatōKatsura All links in the source dir. This is a periodic backup drive. – Luis A. Florit Sep 1 '17 at 16:58
  • What filesystem on the destination? – roaima Sep 3 '17 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.