2

I'm not sure if it is even possible to have an orphaned hard link. Let me explain why I'm asking. Bear with me.

My Setup

I am using rsync to sync my file server to my backup server. I am using the --link-dest rsync option to create a grandfather-father-son scheme (each backup will look like a full backup by using hard links). Example: http://www.mikerubel.org/computers/rsync_snapshots/

The backup server will be running Ubuntu with SnapRaid. SnapRaid will be configured with 1 parity drive.

SnapRaid claims on its homepage that:

If the failed disks are too many to allow a recovery, you lose the data only on the failed disks. All the data in the other disks is safe.

In my case, if 1 drive fails and SnapRaid is unable to restore the system, most of my data should still be there on the remaining drives.

Assumptions

This is where I start to get lost. I am not sure how to test these assumptions just yet. Please let me know if these assumptions are false.

#1

In theory, I should be able to pull out a single drive from my Ubuntu SnapRaid machine, plug it into another computer, and read its contents.

#2

When I plug in a single drive, I would expect to see all the hard links. However, because I am using SnapRaid, the inodes may actually be located on a different hard drive from the hard links.

Question

If my assumptions above are correct, then there is the potential for orphaned hard links when I remove a drive from the SnapRaid configuration.

What happens to these orphaned hard links?

Is this even possible?

zechdc
  • 135
  • 5

3 Answers3

1

I think you probably need to look at how SnapRaid works, but hardlinks can't link across partitions, never mind drives, so you won't see any "orphans" from that source.

Tom Newton
  • 4,021
  • 2
  • 23
  • 28
  • Ya, I guess I need to just spin up a machine with SnapRaid and start playing around with it. Thanks. – zechdc Nov 14 '15 at 19:08
1

Hard links don't work across volumes. Therefore, if a volume disappears there can't, by definition, be an orphan hard link. Hard links are two directory entries that point to the same data blocks (technically... point to the same inode which points to data blocks). Since a directory must be on the same volume as its blocks, you can't end up with orphans.

Luckily rsync is smart enough that it will make a copy if it finds itself in the situation where it can't make a hard link. It will use twice as much disk space, but no additional network bandwidth. In fact, with the "grandfather-father-son scheme" you are using, rsync will use the diff'ing algorithm to save network bandwidth.

Hard disk I/O bandwidth, of course, will be increased any time a file is duplicated across volumes because it must be read from one volume and written on another. This may have significant impact if father and son (or grandfather and father) are on different volumes. It will double or triple the amount of disk I/O being done as every file will not be hardlink'able, and will need to be copied. The worst case would be if grandfather, father, and son are all on different volumes: Essentially no hardlinks will be made! (other than ones within a backup set).

TomOnTime
  • 7,567
  • 6
  • 28
  • 51
1

From my understanding, SnapRaid store file-level parity information and does not mess with lower block level devices.

If so, it should be completely unrelated to how hard-link works. Basically, if you lose too much files to be recovered by parity informations, you will end having an unreadable files (very much like using a single disk with bad sectors).

Back to original question: no, it is not possible to have orphaned hard links. However, you can have hard links which point to a valid but unreadable inode

shodanshok
  • 44,038
  • 6
  • 98
  • 162