Inode |
In Unix Computing, an inode or i-node is a data structure on a file system that stores basic information about a file, directory, or other file system object. The POSIX standard requires at least the following attributes:
Less formally, the term inode can refer to this data structure and the device blocks that it manages. (for a regular file, the blocks constituting the body of the file)
The term inode usually refers to inodes on block devices that manage regular files, directories, and symbolic links. The concept is particularly important to the recovery of damaged file systems.
The inode number is an integer unique to the device upon which it is stored. All files are hard links to inodes. Whenever a program refers to a file by name, the system uses the filename to look up the corresponding inode, which gives the system the information it needs about the file to perform further operations.
The stat (Unix) system call retrieves a file s inode number and some of the information in the inode.
The exact reasoning for designating these as i nodes is unsure. When asked, UNIX pioneer Dennis Ritchie replied:
In truth, I don t know either. It was just a term that we started to use. Index is my best guess, because of the slightly unusual file system structure that stored the access information of files as a flat array on the disk, with all the hierarchical directory information living aside from this. Thus the i-number is an index in this array, the i-node is the selected element of the array. (The i- notation was used in the 1st edition manual; its hyphen became gradually dropped).
= Implications =
The properties of a file system that makes use of the concept of inodes surprises many users who are not used to it at first:
= Implementation of inodes in Linux =
In Linux, inodes are implemented as structs in the C header file linux/fs.h.
= External links =
|
|