Before you can read the parent note on trees, DAGs, hard links and symbolic links, you must earn every word it uses. This page defines them one at a time, each with a picture, each building on the one before. If you have never seen the words inode, link count, or DAG, start at line one and do not skip.
The topic needs this split because every advanced idea — hard links, symbolic links, the DAG — is just a different way of connecting names to numbered lockers.
You need the inode because it is the "one blob" that many names will share. Its metadata (especially a counter) is what makes sharing safe. See Inodes and File Metadata for the full contents, and File System Implementation — Block Allocation for how the block pointers reach real disk.
Recall What are the two columns of a directory entry?
Question ::: What does each entry (name, inode number) store, and which one is the "identity" of the file?
Answer ::: A human-readable name and a numeric inode number. The inode number is the file's true identity; the name is just a label pointing at it.
Following a path from / down to a target is called path resolution; the Unix routine that does it is named namei() (see Path Resolution and the namei() routine). The tool question it answers is: given a string of names, which inode do I end at?
You need n because without it, the moment you had two names for one file, nobody could know whether deleting one name should also free the data. The counter answers that.
The parent note builds two mechanisms on top of everything above. Here is just enough to know what each is:
You now have every symbol the parent note assumes: file, inode, inode number, directory, directory entry, path, root, ./.., link count n, node/edge, tree, and DAG.
Read it top to bottom: the split (A) forces separate inodes (B) and directories (C), which meet at the inode number (D). From there you get walking paths (E), the counter (F), the default tree (G), and — once two names share one inode (I) — the DAG (J) on which hard and symbolic links are built.
Cover the right side and test yourself. If any answer is fuzzy, reread that section before the parent note.
A file separates two things — which two? ::: The bytes (data) and the name (label); joined only by an inode number.
What is an inode, and what does it deliberately NOT store? ::: The record of a file's metadata and data-block pointers; it does not store the file's name.
What are the two columns of a directory entry? ::: (name, inode number).
What do . and .. point at? ::: . points at the directory's own inode; .. points at its parent's inode.
In words, what is the link count n? ::: The number of directory entries currently pointing at that inode.
When may a filesystem free a file's data blocks? ::: When n=0and no process still has the file open.
What makes a graph a tree? ::: Every node except the root has exactly one parent, and there are no cycles — so one unique path per file.
What three properties define a DAG? ::: Directed edges, no cycles (acyclic), but a node may have more than one incoming edge.
What single event turns the tree into a DAG? ::: Two different names (paths) pointing at the same inode, giving it more than one incoming arrow.
Why must directory cycles be forbidden? ::: So traversal terminates and "reachable ⇒ link count > 0" stays well-defined.