Phew.. this article hits a nice sweet spot between simplification(for understanding) vs Too much complicated details. http://www.mikeash.com/pyblog/friday-qa-2013-10-11-why-registers-are-fast-and-ram-is-slow.html
Difference between softlink and hardlink on a ext2 fs.
The ext2 filesystem has a table called MFT(Master File Table).
This is the table that holds inode(hexadecimal short addresses, that point(mapped) to a block of HD memory.)
This is also the table that is created during FS creation, unless am mistake, it is also modified during tune2fs modifying block sizes.
Anyway, to get to the point, softlinking to a file maps an unassigned inode to the existing files inode.
On the other hand Hardlinking just creates a pointer to that inode in the hardlink directory’s entry.
A simple look:
Here’s a file i created with touch and it’s inode:
ls -li test_link
29886232 -rw-r–r– 2 root root 0 Oct 11 21:16 test_link
Here’s the output for a symlink:
ls -li link1
29886233 lrwxrwxrwx 1 root root 9 Oct 11 21:16 link1 -> test_link
Here’s the output for a hardlink:
ls -li link2
29886232 -rw-r–r– 2 root root 0 Oct 11 21:16 link2
If you look at the first column of the output, then you’ll see that it is the same for hardlink and the file.
This is the actual inode value in MFT.