ハードリンクとは?
ハードリンクは、既存のファイルと同じ inode を指すディレクトリエントリであり、両方の名前を同一のデータに対する等しく有効な参照にします。オリジナルとコピーの区別はなく、その inode への最後のリンクが削除されるまでファイルの内容は残ります。ハードリンクは同じ filesystem 上に留まる必要があります。
なぜ重要か
ハードリンクにより、ツールは cache 全体で同一ファイルを重複排除でき、ディスク使用量を倍にせずに済みます。これは build の cache が活用します。両方の名前が1つの inode を共有することを知っていれば、一方を削除してもデータが解放されない理由が分かります。
関連ガイド
What Is an Inode?An inode is the on-disk record that stores a file metadata and the location of its data blocks, while the fil…
What Is a Symbolic Link Target?A symbolic link target is the path a symlink stores and points to; the link is a small file holding that path…
What Is an Overlay Filesystem?An overlay filesystem stacks a writable layer on top of read-only layers, presenting a merged view while keep…