Inode
Subject: Computer and Technology noun /ˈaɪ.noʊd/ 1 definition
- file-systems
- operating-systems
- unix-internals
- storage-architecture
-
Definition (noun)
Entry #204 · UpdatedAn Inode (short for index node) is a fundamental data structure in Unix-like file systems that represents a file system object—such as a regular file, directory, or symbolic link—and records its metadata alongside references to its data blocks. Identified by a unique integer inode number within a given file system, it tracks attributes including ownership, permissions, timestamps, byte size, and hard-link count. Crucially, an inode does not store the object's filename or directory path; directory entries map human-readable names to inode numbers, decoupling object identity from naming to enable hard links and atomic file replacement.
Common Types
Regular File Inode: Tracks file attributes and points to the data blocks or extents holding a file's byte stream.
Directory Inode: References data blocks containing a lookup table that maps child filenames to their corresponding inode numbers.
Symbolic Link Inode: Holds a target pathname—stored inline inside the inode for short paths or in a data block—for dynamic path redirection.
Special File Inode: Represents devices, named pipes (FIFOs), or Unix sockets by recording major/minor device numbers or kernel endpoints instead of data blocks.
Example
When an administrator creates a hard link with
ln app.log app.log.bak, the file system adds a second directory entry pointing to the same inode number (for example,1048579) and increments its link count from1to2without copying any data blocks. Even if both filenames are later unlinked while a logging daemon still holds the file open, the kernel preserves the inode and its disk space until every remaining open file descriptor is closed.