1

I've read a lot recently about how making backups with rsync using hardlinks (--link-dest) is a good solution as it's so fast and the backup is complete. But surely it's really a very bad solution because if the data on the disk is corrupted (disk failure, bad blocks,...) the backup is completely useless.

Or am I missing something?

3
  • The first thing to determine is "what is the purpose of the backup?". What is the thing you are trying to protect against? If you are making the backup on the same machine then it doesn't save you in the case of fire or theft. You seem to be assuming that your "disk" has no redundancy, so for example it isn't raid, and your file system doesn't have integrity checks.
    – icarus
    Dec 6, 2022 at 19:47
  • @icarus - if you are going to rely on the security of raid to secure the backup, then there is no point in making a backup in the first place, is there?
    – johnmuir
    Dec 6, 2022 at 22:19
  • You really need to determine why you are making the backup. Are you trying to protect against a disk failing? Are you trying to protect against a ransomware virus encrypting all your files? Are you concerned you might accidentally type rm -rf /? What about your residence is destroyed by a flood or hurricane? Are you going to edit the file and want an older copy "just in case"? There is a statement "RAID is not backup", raid will only protect you from at most one of the things on this list.
    – icarus
    Dec 8, 2022 at 21:14

1 Answer 1

1

The normal way to use hard links as part of rsync backups is for the incremental part of incremental backups. The backups are never hard linked to the originals. But if a file hasn't changed between (e.g.) the Monday backup and the Tuesday backup, then the Tuesday backup can make a hard link to the copy of the file in the Monday backup. You do this with rsync by passing --link-dest=/path/to-backups/monday when doing the Tuesday backup.

5
  • @Giles - yes, I understand how it works, but the point is that if the underlying data is corrupt, then the backup is useless.
    – johnmuir
    Dec 6, 2022 at 22:19
  • @johnmuir, I suppose the assumption is that the (regular) user doesn't or can't go messing about with the backup files the way they can mess about with the originals.
    – ilkkachu
    Dec 6, 2022 at 22:44
  • @johnmuir The backup is independent from the original data. The different snapshots inside the backup are not independent from each other. That's a choice. If you want independence, obviously, don't use this approach. Dec 6, 2022 at 23:03
  • @Giles "backup is independent from the original data" if you use hardlinks the backups ARE the original data. "different snapshots inside the backup are not independent from each other" as the Germans say 'Doch!' each backup is completely independant.
    – johnmuir
    Dec 7, 2022 at 10:40
  • @johnmuir Once again, if you want each backup to be independent, don't use hard links. It depends how much you're prepared to pay. In many environments, it's reasonable not to accept that if one physical media fails, it might affect multiple days' backups. The primary job of incremental backups is to have older versions of a file in case the file is modified or removed but the older version turns out to be needed after all. Dec 7, 2022 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .