Back to lessons

Hosting Operations

Check Inodes When Disk Space Looks Fine

You need to check whether a filesystem has run out of inodes.

Command

df -ih

What changed

Nothing changes. The command reports inode availability by filesystem.

Danger

safe

When to use it

Use when file creation fails even though df -h shows available space.

When not to use it

Do not use it to locate the directory with too many files; follow up with targeted directory inspection.

Undo or recovery

No undo needed because this command is read-only.

Expected output

A filesystem table showing inode totals, used inodes, free inodes, inode use percentage, and mount points.

demo script

Disposable terminal steps

  1. df -h
  2. df -ih

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        25G   23G  1.1G  96% /
tmpfs           982M   12M  970M   2% /run
::exit-code::0
$ df -ih
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/vda1        512K  501K   11K   98% /
tmpfs            245K    12  245K    1% /run
::exit-code::0

YouTube Short

No space, but free GB?

If bytes are available but files still cannot be created, check inode usage with df -ih.

LinkedIn hook

Sometimes the disk has free bytes but still cannot create files.

Question: Have you hit inode exhaustion on a server that still had free GB?

experiments

A/B tests to run

Metric: share_rate

A: Free bytes are not enough.

B: No space left can mean inodes.