{
  "slug": "ext4-orphan-inode",
  "term": "Ext4 orphan inode",
  "aliases": [
    "orphan inode (ext4)"
  ],
  "definition": "An ext4 orphan inode is an inode tracked so recovery can finish deletion or remove excess allocations left by an interrupted truncation or extension.",
  "note": "An unlinked file may remain alive while open; ext4 records recovery work so a crash does not leave its inode and blocks permanently allocated. Linked files can also need orphan tracking when truncation or extension spans journal transactions, so orphan does not mean only a file without directory entries. [linux-ext4-orphan-layout] In Linux v6.12, ext4_process_orphan uses the recovered link count: linked inodes are truncated to the recovered inode size, while zero-link inodes are released for deletion. [linux-v6-12-ext4-orphan] See the Hesela analysis for the relationship to journal replay. [hesela-ext4-orphan-cleanup]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "Linux v6.12 increments nr_truncates even after an ext4_truncate error if execution continues; its cleanup count alone does not certify successful repair. Read accompanying errors.",
      "citationIds": [
        "linux-v6-12-ext4-orphan"
      ]
    },
    {
      "text": "Cleanup reclaims allocations; it is not undelete, secure sanitization, or an application durability guarantee.",
      "citationIds": [
        "linux-v6-12-ext4-orphan",
        "linux-fsync-2"
      ]
    },
    {
      "text": "In Linux v6.12, cleanup skips a read-only block device but may temporarily permit writes for a read-only filesystem mount on writable media; read-only mounting alone is not a no-write guarantee.",
      "citationIds": [
        "linux-v6-12-ext4-orphan"
      ]
    }
  ],
  "related": [
    "inode",
    "unlink",
    "ext4-orphan-file",
    "read-only-mount"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "linux-ext4-orphan-layout",
      "title": "Linux ext4 documentation: Orphan file (v6.12)",
      "url": "https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/Documentation/filesystems/ext4/orphan.rst",
      "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": "linux-fsync-2",
      "title": "Linux manual: fsync(2)",
      "url": "https://man7.org/linux/man-pages/man2/fsync.2.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "hesela-ext4-orphan-cleanup",
      "title": "Hesela: ext4 journal replay and orphan cleanup",
      "url": "https://hesela.com/analyses/ext4-journal-replay-revocation/#orphan-cleanup",
      "accessed": "2026-10-15"
    }
  ],
  "updated": "2026-10-15"
}
