Hard Links in Windows – risk of file-loss?

I am now creating hard links to remove duplicate space usage in backup data.
This is within single NTFS partitions.

I am afraid of data-loss – losing a file completely if one link reference is broken, other link references will be lost if one is deleted, or more versions change when one version change.

Is there some way to do this that will branch off the file if one changes.
(If there are two link references to a file, and one changes, we get 2 independent files.)

Any risks with syncing solutions like Dropbox?

For now I am only dealing with files, not directories.

Answer

Branching off files in case of changes is easy using hard links: Just delete the file that changed by path and put the changed one in place. Hard links point to data, but are independent paths and therefore can be deleted without affecting other hard links or the data itself. The only risky part is writing directly into the file behind a hard link, because this of course would change the data for all hard links pointing to that data, simply because there’s only one data for all “the same” hard links available. So you need to know if things have changed and if so need to create a new file.

As you are asking for backup purpose, your problem shouldn’t arise anyway: Each change of a file should result in a new file in the backup, without any change you can create hard links to already available data. So your process would need to check for changes first anyway, I don’t see where you need to decide if and how you want to change things in the backup. Backup is about leaving everything already present as it is and only decide how to add new things.

In general, I would not recommend implementing such things on your own, it’s simply too complex and too easy to get things wrong. There are already solutions available implementing what you have in mind, e.g. a tool called HardlinkBackup.

Attribution
Source : Link , Question Author : Olav , Answer Author : Thorsten Schöning

Leave a Comment