Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
service
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
6 user(s) are online (5 user(s) are browsing encyclopedia)

Members: 0
Guests: 6

more...
partner

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:

  • The length of the file in byte
  • Device ID (this identifies the device containing the file)
  • The User identifier (Unix) of the file s owner
  • The Group identifier (Unix) of the file
  • An inode number that identifies the file within the filesystem
  • The file mode , which determines what users can read, write, and execute the file
  • Timestamps telling when the inode itself was last changed (ctime), the file content last modified (mtime), and last accessed (atime)
  • A Reference counting telling how many hard link point to the inode
  • 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:

  • If multiple names link to the same inode (they are hard links to each other) then all of the names are equivalent. The first one to have been created has no special status. This is unlike sometimes more familiar Symbolic link where all of the links depend on the original name.
  • An inode can even have no links at all. Normally such a file would be removed from the disk and its resources freed for reallocation (the normal process of deleting a file) but if any processes are holding the file open, they may continue to access it, and the file will only be finally deleted when the last reference to it is closed. This includes executable images which are implicitly held open by the processes executing them. For this reason, when programs are updated, it is recommended to delete the old executable first and create a new inode for the updated version, so that any instances of the old version currently executing may continue to do so unbothered.
  • = Implementation of inodes in Linux =

    In Linux, inodes are implemented as structs in the C header file linux/fs.h.

    = External links =

  • [http://www.cse.unsw.edu.au/~neilb/oss/linux-commentary/vfs-7.html The Linux Virtual File-system Layer: Inodes and Operations] - I-nodes in Linux