{
  "slug": "inode",
  "term": "Inode",
  "aliases": [
    "index node"
  ],
  "definition": "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.",
  "note": "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. [linux-v6-12-ext4-orphan]\n\nLinux 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. [ext4-handle] [handle-lifetime]\n\nWith 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. [inode-csum] Linux v6.6 initializes i_generation randomly at allocation; it is not a trusted counter of every metadata change. [inode-generation] Freshness requires a separately retained intended state, not just a matching inode identity. [freshness-paper]",
  "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.",
    {
      "text": "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.",
      "citationIds": [
        "inode-freshness-witness"
      ]
    }
  ],
  "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",
    "metadata",
    "unix-domain-socket",
    "link-count",
    "xfs-allocation-group",
    "ext4"
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-12-01",
  "citations": [
    {
      "id": "linux-inode-7",
      "title": "Linux man-pages 6.19: inode(7)",
      "url": "https://man7.org/linux/man-pages/man7/inode.7.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "linux-stat-3type",
      "title": "Linux man-pages 6.19: stat(3type)",
      "url": "https://man7.org/linux/man-pages/man3/stat.3type.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "linux-open-2",
      "title": "Linux man-pages 6.19: open(2)",
      "url": "https://man7.org/linux/man-pages/man2/open.2.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "hesela-namespace",
      "title": "Hesela: The name changes; existing readers do not",
      "url": "https://hesela.com/analyses/atomic-rename-directory-durability/#namespace-identity",
      "accessed": "2026-10-15"
    },
    {
      "id": "linux-v6-12-ext4-orphan",
      "title": "Linux v6.12: ext4 orphan inode handling",
      "url": "https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/fs/ext4/orphan.c",
      "accessed": "2026-10-15"
    },
    {
      "id": "ext4-handle",
      "title": "Linux v6.8: ext4_nfs_get_inode generation validation",
      "url": "https://github.com/torvalds/linux/blob/v6.8/fs/ext4/super.c#L1436-L1453",
      "accessed": "2026-11-09"
    },
    {
      "id": "handle-lifetime",
      "title": "Linux v6.8: name_to_handle_at drops the lookup reference; handle reopening resolves the filesystem object again",
      "url": "https://github.com/torvalds/linux/blob/v6.8/fs/fhandle.c",
      "accessed": "2026-11-09"
    },
    {
      "id": "inode-csum",
      "title": "e2fsprogs v1.47.0: ext2fs_inode_csum inputs and checksum verification",
      "url": "https://raw.githubusercontent.com/tytso/e2fsprogs/v1.47.0/lib/ext2fs/csum.c",
      "accessed": "2026-12-01"
    },
    {
      "id": "inode-generation",
      "title": "Linux v6.6: ext4 inode allocation initializes i_generation",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.6/fs/ext4/ialloc.c",
      "accessed": "2026-12-01"
    },
    {
      "id": "freshness-paper",
      "title": "Krioukov et al., Parity Lost and Parity Regained, FAST 2008, sections 4.5-4.7",
      "url": "https://www.usenix.org/legacy/event/fast08/tech/full_papers/krioukov/krioukov_html/index.html",
      "accessed": "2026-12-01"
    },
    {
      "id": "inode-freshness-witness",
      "title": "Hesela: native ext4 inode replay, permission checks and offline experiment limits",
      "url": "https://hesela.com/analyses/checksums-identity-and-lost-writes/#ext4-inode-freshness",
      "accessed": "2026-12-01"
    }
  ],
  "provenance": [
    "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. [freshness-paper]",
    "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. [inode-generation] [inode-freshness-witness]"
  ]
}
