5 ms·
The single advantage of what this could do for you is easier (faster) access to all the hardlinks a given file may have; in current file systems like ext4 there
by DemocracyFTW2 4y ago
The single advantage of what this could do for you is easier (faster) access to all the hardlinks a given file may have; in current file systems like ext4 there's no way of getting to all hardlinks short of searching the entire drive if I'm not mistaken.
Other than that, I see little in the way of a value proposition of this over existing file systems. There's relatively little what you can and will do with hardlinks anyway; two things I can think of is (1) making backups the MacOs timemachine way with hardlinks for all files that have remained untouched since the most recent backup session, and (2) maintaining a 'physical clone' of configuration file in a more convenient location (that can then be backuped without producing dangling symlinks).
Other than that, symlinks are IMHO preferable over hardlinks because symlinks are (1) actually less brittle than hardlinks when copying (archivers will store symlinks, and, done properly, they will remain being symlinks and spring back to life when restored to an appropriate environment, or can be rewritten in the bulk when sources and/or targets have been moved relatively to each other). With hardlinks, you'll have to very careful to maintain the single-storage-with-two-entries semantics.
(2)ndly, symlinks are systematically preferrable over hardlinks because they can (2a) point to any mounted location and (2b) allow to produce a two-tiered structure where the primary structure stays a tree without surprising identities between far-flung identities between /that/file/i/thought/was/unique.txt and /that/other/file/that/accidentally/changed/for/no/obvious/reason.txt ("spooky action at a distance" which even the universe deems too difficult to bother about). The existence of symlinks documents that "the secondary location (name, path) for the given file is here, while its primary location is elsewhere. Hardlinks won't give you that.
I've never heard of tools that when given two distinct locations in two distinct snapshot sessions will be able to re-build the shared hardlink semantics of the original situation of your disk. One way to achieve this could be to use a content-addressed FS and have a bit on each file entry that states whether the entry is meant to be copy-on-write (COW), i.e. an independent copy or not, when it is treated as a 'lockstepped' clone. That might turn out to be as brittle as it sounds, though.