On many *nix systems like OS X and Ubuntu, We can see the inode of root directory is 2. Then what is the inode 1 used for?

  • 7
    This will differ by filesystem; are you interested in a particular one? Commonly inode 1 is used for the list of bad blocks, but it's not required. – Michael Homer Apr 26 '15 at 8:49
  • 2
    This SO answer may be relevant: stackoverflow.com/a/2109363/2808351 – dhag Apr 27 '15 at 18:29

Inode 0 is used as a NULL value to indicate that there is no inode.

Inode 1 is used to keep track of any bad blocks on the disk; it is essentially a hidden file containing the bad blocks. Those bad blocks which are recorded using e2fsck -c.

Inode 2 is used by the root directory, and indicates starting of filesystem inodes.

  • We should note that except for 0 the values come from tradition and are not really fixed. For example minixfs has / as inode 1 and badblocks as whatever inode /.badblocks is. – Joshua Apr 6 '18 at 16:04

In ext4 the Inode 1 is used for bad blocks. The link below the the kernel site describes which Inode is used for what purpose.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.