Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File systems with support to directory hard-linking

Does anybody know one? preferrably with linux implementation?

alternatively, does anybody know how much effort would it take to add it in any open-source implementation? (i mean: maybe it's enough to change an if statement, maybe i have to go carefully trhough the whole fs implementation adding tests; do you have that notion? ).

thanks....

like image 783
ribamar Avatar asked Dec 11 '10 10:12

ribamar


2 Answers

HFS+ allows directory hardlinks in OSX 10.5. Only TimeMachine can create them since OSX 10.6, and HFS+ does some sanity checking that they do not introduce cycles.

However, Linux will not read them. Besides filesystems, this could be enforced at the VFS layer. Even if there are no cycles, some userspace tools rely on having no directory hard links (eg, a GNU find optimisation that lets it skip many directories; it can be disabled with -noleaf ).

like image 59
Tobu Avatar answered Sep 21 '22 06:09

Tobu


Technically nothing keeps you from opening /dev/sda with a hex editor and creating one. However everything else in your system will fall apart if you do.

The best explanation i could find is this quote from jta:

User-added hardlinks to directories are forbidden because they break the directed acyclic graph structure of the filesystem (which is an ASSERT in Unixiana, roughly), and because they confuse the hell out of file-tree-walkers (a term Multicians will recognize at sight, but Unix geeks can probably figure out without problems too.

like image 31
Martin Olsen Avatar answered Sep 18 '22 06:09

Martin Olsen