It's well known that the /
directory has inode number 2 (see also Why does '/' have the inode 2). And we also know that hard links share the same inode number. So far so good.
Here's the confusing bit (notice the Inode:
part):
$ stat /run
File: /run
Size: 940 Blocks: 0 IO Block: 4096 directory
Device: 16h/22d Inode: 2 Links: 32
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-09-10 10:22:18.198727482 +0800
Modify: 2018-09-10 02:47:58.655999930 +0800
Change: 2018-09-10 02:47:58.655999930 +0800
Birth: -
The simple question is "Why do they have the same inode?" The /run
directory is different from /
and /run
is not hardlink to /
.
/run
is usually atmpfs
and that rule doesn’t apply — what doesmount | grep 'on /run '
output? – Stephen Kitt Sep 10 '18 at 04:34tmpfs
file systems don’t have a fixed root inode. – Stephen Kitt Sep 10 '18 at 04:47Inode: 14511
and it'stmpfs
./
is inode 2 though (ext4)./tmp
is tmpfs and inode 2860. Fedora 25 dom0 under Qubes OS 4.0 – Sep 10 '18 at 04:50