user3282758
user3282758

Reputation: 1483

what are inode numbers 1 and 2 used for

I find that in my ubuntu distribution, the following files are all allocated inode nos 1 : /dev/pts, /sys, /proc, /sys/kernel/security, and a few more entries.

Now somewhere I have read that inode# 1 is 'bad blocks inode' and thus the root directory is allocated inode# 2.

My question is : 1) If that be the case why all those directories are allocated this 'bad blocks inode' no

2) why all these files share the same inode no when they are not even links

3) why is / and /sys/fs and /dev/pts/ptmx allocated the same inode no 2

Upvotes: 2

Views: 3318

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799490

inode 1 is the "bad blocks" inode on a ext2/3/4 filesystem. inode counts exist per filesystem. /dev/pts, /sys, and /proc are mounted from other filesystems.

Upvotes: 5

Related Questions