Use it when a disk shows free space but "No space left on device" appears, or to understand hard links.
Inodes
An inode is the on-disk record of a file: type, owner, permissions, size, timestamps and where the data blocks are. Directory entries map names to inode numbers; the name is not stored in the inode.
1. df -i <path> — IUse% at 100%?
2. Find directories with many files: du --inodes -xS <mount> | sort -n | tail.
3. Space not freed after delete → lsof +L1 — process holding deleted files.
4. Restart or signal that process to release them.
5. Check df -h and df -i again.
name in a directory → inode number → inode (metadata, block map) → data blocks
For Filesystem → Inodes, continue with the first unproven Topic check: Record filesystem/device identity together with inode number; never compare inode numbers alone across filesystems. If that boundary is healthy, advance to the adjacent check: Inspect link count, file type, metadata and open-handle references. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
df -iVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
pathname → directory entry/dentry → filesystem + inode number → inode metadata/link count → data extents/blocks → open-file references → operation result
Healthy evidence: filesystem identity and inode number map consistently to the expected names/links, capacity is available and open-reference lifecycle matches the observed storage usage.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Record filesystem/device identity together with inode number; never compare inode numbers alone across filesystems.
- Inspect link count, file type, metadata and open-handle references.
- Check both block-space and inode-space exhaustion when file creation fails.
- Verify space/object lifecycle after closing holders or removing the final link.
Verification chain. pathname → directory entry/dentry → filesystem + inode number → inode metadata/link count → data extents/blocks → open-file references → operation result
Step 3 Commands Verify boundary
df -i
ls -i file
stat file
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: inode numbers are compared across filesystems, free bytes hide inode exhaustion, or an unlinked open file is expected to release space immediately.
Step 5 Common mistakes Narrow the fault
- Running out of inodes with millions of small files.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A filesystem has a fixed number of inodes on ext4; millions of small files can exhaust them while space remains — df -i shows it. Deleted files still held open by a process keep their inode and space until the process closes them (lsof +L1).
df -i— inode usage per filesystemls -i <file>— inode numberlsof +L1— deleted files still openls -ld <path>— owner, permissions and typestat <path>— inode, links, size and timestampsdf -h <path>— filesystem and free spacefindmnt <path>— which mount the path is on
ReferenceWhat it is1 section · depth on demand
Core model
Resolve the pathname to device/filesystem plus inode number, inspect link count, type, ownership/timestamps/size and any open handles. Separate free data blocks from free inode capacity. For deleted-but-open files, the name can disappear while the inode/data remains allocated until the last reference closes.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
Inode evidence shows filesystem-local object identity and metadata, not pathname uniqueness, cross-filesystem identity or immediate data release after unlink.
In depth
Inodes: what a file really is
A file name is only an entry in a directory, and the file itself is an inode. The inode(7) manual page lists what an inode holds:
- the device and inode number;
- the file type and permission mode;
- the link count;
- the owner UID and GID;
- for device files, the device ID;
- the size and the number of allocated blocks;
- timestamps.
The file name isn't in the inode. It's in the directory that points to it.
Timestamps (manual)
| Timestamp | Changed by |
|---|---|
| atime (access) | Reading the file (subject to mount options) |
| mtime (modification) | Writing the contents; for directories, adding or removing entries |
| ctime (status change) | Changes to the inode: owner, group, mode, link count, and writes |
| btime (birth) | Set at creation; supported only by some file systems |
noatime, nodiratime and relatime reduce atime updates.
Inode exhaustion
Some file systems (ext4) create a fixed number of inodes when they're formatted. Millions of tiny files, such as session files, cache entries or mail queues, can use up all inodes while there's still free space. New files then fail with "No space left on device", even though df -h shows free space. XFS and Btrfs allocate inodes dynamically, so they rarely have this problem.
host$ stat /etc/hostname
File: /etc/hostname
Size: 5 Blocks: 8 IO Block: 4096 regular file
Device: 253,0 Inode: 1835093 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2026-11-28 08:59:58.412000000 +0100
Modify: 2026-03-03 10:12:41.000000000 +0100
Change: 2026-03-03 10:12:41.000000000 +0100
Birth: 2026-03-03 10:12:41.000000000 +0100
host$ ls -i /etc/hostname
1835093 /etc/hostname
host$ df -i /var
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 3276800 3276800 0 100% /var
host$ sudo find /var -xdev -type f | cut -d/ -f2-4 | sort | uniq -c | sort -rn | head -3
2981004 var/lib/php
host$ sudo find /var/lib/php/sessions -type f -mmin +1440 -delete
Reading the example
df -i shows 100 % of inodes used on /var, which explains "no space" errors. The find pipeline counts files per directory and points to almost three million PHP session files. Deleting the stale ones frees inodes immediately. Fixing the session cleanup prevents it from happening again.
Documented example, not captured output.
How it works at runtime
Inodes is part of Filesystem → Inodes. Inodes are filesystem metadata objects that identify files/directories within a filesystem and hold metadata plus references to data, while directory entries map names to inode numbers; inode identity is filesystem-local and a file may have multiple hard-link names.
Topic-specific state model. Inodes are filesystem metadata objects that identify files/directories within a filesystem and hold metadata plus references to data, while directory entries map names to inode numbers; inode identity is filesystem-local and a file may have multiple hard-link names.
Interpretation rule. - Filename ≠ inode; directory entry maps a name to an inode.
- Same inode number on different filesystems ≠ same object.
- Free bytes available ≠ free inodes available on filesystems with finite inode allocation.
- File unlinked from directory ≠ storage released while a process still holds it open.
Quick reference
An inode stores file metadata (type, mode, owner, size, timestamps, link count, data block pointers) — everything except the name. Directories map names to inode numbers.
ls -i file; stat file
df -i
find / -xdev -inum 1234567 # find names for an inode
debugfs -R 'stat <12>' /dev/sda1 # ext4 low-level view
Running out of inodes gives "No space left on device" with free blocks; find directories with many files: find /var -xdev -type f | cut -d/ -f1-4 | sort | uniq -c | sort -rn | head.
Limits and how it fails
Primary failure point. Inode evidence shows filesystem-local object identity and metadata, not pathname uniqueness, cross-filesystem identity or immediate data release after unlink.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Inodes owns generic Linux inode/name-reference semantics. Filesystem-specific allocation internals, permissions and process open-file troubleshooting belong to specialist branches.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Filesystem → Inodes. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Inodes operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Inodes.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Inodes are filesystem metadata objects that identify files/directories within a filesystem and hold metadata plus references to data, while directory entries map names to inode numbers; inode identity is filesystem-local and a file may have multiple hard-link names. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin process/container mount namespace → resolve the exact path from / and record every mount crossing → identify final dentry + filesystem/device + inode + file type → capture ownership/mode/ACL and capacity where relevant → map pseudo/device/runtime objects to the live kernel/process endpoint → verify the original consumer read/write/execute/service result. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | pathname → directory entry/dentry → filesystem + inode number → inode metadata/link count → data extents/blocks → open-file references → operation result | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Inode evidence proves filesystem-local object identity and metadata, not pathname uniqueness, cross-filesystem identity or immediate data release after unlink. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated namespace, path and object evidence can establish this Linux Filesystem proof path: pathname → directory entry/dentry → filesystem + inode number → inode metadata/link count → data extents/blocks → open-file references → operation result | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured namespace, mount, inode/object, authorization, backing-resource or consumer scope. Inode evidence proves filesystem-local object identity and metadata, not pathname uniqueness, cross-filesystem identity or immediate data release after unlink. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: preserve the same process mount namespace, resolve the path and mount crossings, identify the exact object/inode or live pseudo/device endpoint, inspect effective access/capacity, then repeat the original consumer operation before changing unrelated filesystem state. | Continue to the next unresolved boundary while preserving the original test condition. |
Inodes · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Inodes |
|---|---|
| Topic path | Filesystem → Inodes |
| Runtime state | Inodes are filesystem metadata objects that identify files/directories within a filesystem and hold metadata plus references to data, while directory entries map names to inode numbers; inode identity is filesystem-local and a file may have multiple hard-link names. |
| Fast checks | - Record filesystem/device identity together with inode number; never compare inode numbers alone across filesystems. - Inspect link count, file type, metadata and open-handle references. - Check both block-space and inode-space exhaustion when file creation fails. - Verify space/object lifecycle after closing holders or removing the final link. |
| Verification chain | pathname → directory entry/dentry → filesystem + inode number → inode metadata/link count → data extents/blocks → open-file references → operation result Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Inode evidence proves filesystem-local object identity and metadata, not pathname uniqueness, cross-filesystem identity or immediate data release after unlink. Boundary chain: process credentials/namespace → path/mount lookup → DAC/ACL/LSM → filesystem metadata → block/device/backend → completion/read-back. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |