I was reading the EXT4 doc about special inodes. It states that a FS root directory has inode #2. There are many posts in which people ask why directories like /dev
, /proc
, /run
, /sys
, and so on, have also inode #2, the answer usually being :
they're virtual filesystems, so since they are root folders for their filesystem, they also have inode 2
But on my system (Debian 11, EXT4), all those directories have inode #1 :
$ stat /sys | grep Inode
Device: 14h/20d Inode: 1 Links: 13
$ stat /proc | grep Inode
Device: 15h/21d Inode: 1 Links: 341
$ stat /run | grep Inode
Device: 17h/23d Inode: 1 Links: 33
$ stat /dev | grep Inode
Device: 5h/5d Inode: 1 Links: 22
EXT4's doc states that Inode #1 is for List of defective blocks.
What's going on there ? Why don't those directories have inode #2, like they apparently have with other people ?
mount | grep /blah
. – dave_thompson_085 Jan 11 '24 at 07:17/proc
and/sys
, and 2 for/dev
andrun
. So things were not that constant even back then. And of course, any talk of ext4 is completely irrelevant to the discussion since none of these are ext4 filesystems. – muru Jan 11 '24 at 07:50