inode · shipping · also index node

Inode

An inode is a filesystem object that holds a file's metadata and has a filesystem-local number, distinct from the directory names and open file descriptions that refer to the file.

On Linux, stat() exposes the inode number as st_ino, the containing device as st_dev, and the hard-link count as st_nlink. Inode numbers alone are not unique across filesystems. A pathname replacement can select a different inode while an existing descriptor still refers to the previous file; inode identity is therefore different from pathname identity and from a content version. In ext4, a linked inode can also be tracked for recovery of incomplete truncation; an orphan is not necessarily an inode with no names. [5]

Linux file handles can include more than an inode number. In Linux v6.8 ext4, a nonzero supplied generation must match i_generation or reopening fails with ESTALE; zero skips that comparison. This identity check is not a content-version check, and saving handle bytes does not retain an open file. [6] [7]

With ext4 metadata checksums, the inode check includes the filesystem seed, inode number, i_generation and inode bytes, with checksum fields zeroed. With the same filesystem seed and inode number, a complete historical inode restores i_generation, inode bytes and their valid checksum together. [8] Linux v6.6 initializes i_generation randomly at allocation; it is not a trusted counter of every metadata change. [9] Freshness requires a separately retained intended state, not just a matching inode identity. [10]

Relations

related
Hard link, Unlink, Atomic rename, Open file description, Ext4 orphan inode, Ext4 orphan file, File modification time, Inode change time, File access time, File birth time, statvfs, Filesystem quota, Symbolic link, Path resolution, Dentry, Linux file handle, Filesystem, Directory, Regular file, Character device, Named pipe (FIFO special file), Metadata, Unix-domain socket, Link count, XFS allocation group, Ext4

Advantages

  • Separates file metadata and identity from the names used to reach a file.

Limitations

  • An inode number alone is not a globally unique or permanent content identifier.
  • Matching inode identity does not imply unchanged file contents or a shared open file description.
  • A digest of file contents cannot establish that intended permissions survived when the payload is unchanged; the native ext4 permission-replay example demonstrates this on offline images without a journal. [11]

Citations

  1. Linux v6.12: ext4 orphan inode handling (accessed 2026-10-15)
  2. Linux v6.8: ext4_nfs_get_inode generation validation (accessed 2026-11-09)
  3. Linux v6.8: name_to_handle_at drops the lookup reference; handle reopening resolves the filesystem object again (accessed 2026-11-09)
  4. e2fsprogs v1.47.0: ext2fs_inode_csum inputs and checksum verification (accessed 2026-12-01)
  5. Linux v6.6: ext4 inode allocation initializes i_generation (accessed 2026-12-01)
  6. Krioukov et al., Parity Lost and Parity Regained, FAST 2008, sections 4.5-4.7 (accessed 2026-12-01)
  7. Hesela: native ext4 inode replay, permission checks and offline experiment limits (accessed 2026-12-01)

Further reading

  1. Linux man-pages 6.19: inode(7) (accessed 2026-10-15)
  2. Linux man-pages 6.19: stat(3type) (accessed 2026-10-15)
  3. Linux man-pages 6.19: open(2) (accessed 2026-10-15)
  4. Hesela: The name changes; existing readers do not (accessed 2026-10-15)
Sources & caveats
  • The FAST 2008 source models parity-based protection under single errors; it is not an ext4 experiment. The freshness requirement here is a source-based interpretation, not a universal recovery guarantee. [10]
  • The ext4 witness fixes i_generation in both baseline states. Allocation behavior is source-reviewed in Linux v6.6, not measured on a mounted kernel. [9] [11]

JSON: /data/terms/inode.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Inode. Hesela. 2026-12-01. https://hesela.dev/terms/inode/