Hard Link question – Linux & Unix – BleepingComputer

I am considering using hardlinks to reduce the use of disk resources in Linux (lets keep this simpler).  There are two groups of files I am considering using links one — one is videos and pictures, Videos I edit but the edited copies are not dups to the originals and a renamed in the editing processs.  Pictures I do not edit so no issue.  Spreadsheets and other textual documents are better handled in a source control system.  The other scenario is an archival situation.  Once the hardlink dup removal process has been run on new data added to the archive that data will be READ ONLY to everything except the dup removal process so even text files that could be modified will enter the system as NEW FULL COPIES (generally in a folder identified by the date of the copy) that are compared to the old unequal copies preventing any issues.


Given the above uses, I read hard links can only be in the same “filesystem”.  Where the understanding of filesystem seems to be assumed and I believe it is not entirely clear.  One example a set of simple ext4 partitions assembled into the OS ROOT “filesystem” using /etc/fstab are in my opinion multiple file systems one for each physical partition as the inodes are specific to the physical partition and even those in the OS Root partition have inodes that would be specific to ONLY that partition.  Meaning two partitions on the same drive even if in /etc/fstab would still be two separate file systems in terms of hard linking files.  There is probably an exception to this when striped/mirrored disks or partitions are involved; as in the set of disks or partitions participating in a single striped/mirrored unit would be considered one hardlink filesystem.


Based on those assumptions in the ZFS filesystem, I am not sure hard links are possible and they are probably not needed because snapshots can perform the same archival process that prevents the creation of duplicate data on the hardware media.  But if links are allowed links would only be possible inside the pool where the partitions or disks were assigned (basically the same principle I followed with the conventional ext4 partitions.


Thanks to anyone that can confirm that my analysis is either accurate or point out where it is inaccurate.

Source: https://www.bleepingcomputer.com/forums/t/764602/hard-link-question/

Posted on

Leave a Reply

Your email address will not be published. Required fields are marked *