How to find inodes within a file?

Why are the first two inodes reserved in the Unix file system?

  • The wikipedia page http://en.wikipedia.org/wiki/Unix_File_System says that Inodes are numbered sequentially, starting at 0. The first two inodesĀ  are reserved for historical reasons, followed by the inode for the http://en.wikipedia.org/wiki/Root_directory, which is always inode 2. What are those historical reasons?

  • Answer:

    On ext2 there are more than two inodes reserved for some special purpose as follows: Inode 0 is used as a senital value to indicate null or no inode. similar to how pointers can be NULL in C. without a sentinel, you'd need an extra bit to test if an inode in a struct was set or not. Inode 1 is the bad blocks inode - I believe that its data blocks contain a list of the bad blocks in the filesystem, which should not be allocated. Inode 2 is the root inode - The inode of the root directory. It is the starting point for reaching a known path in the filesystem. Inode 3 is the acl index inode. Access control lists are currently not supported by the ext2 filesystem, so I believe this inode is not used. Inode 4 is the acl data inode. Of course, the above applies here too. Inode 5 is the boot loader inode. Inode 6 is the undelete directory inode. It is also a foundation for future enhancements, and is currently not used. Inodes 7-10 are reserved and currently not used. You can read in details here http://uranus.chrysocome.net/explore2fs/es2fs.htm

Raghav Yadav at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.