Linux Performance

Check disk space and inodes on Linux

No space left can mean inodes, not bytes — check both.

8 min read Beginner Updated 9 Jun 2026

Step-by-step guide

Work through each section in order. Stop when your issue is resolved — you do not need every step for every situation.

Warning

A filesystem at 100% capacity can prevent login and break databases. Inode exhaustion with free disk space is a classic mail-server trap — check both before deleting random files.

What you will achieve

Diagnose full disks and exhausted inode tables on Ubuntu and Debian using df, understand the difference, and know where to look next.

1) Human-readable disk space

df -h
df -h / /var /home

Watch the Use% column. Root at 100% breaks apt, logging, and cron. /var fills from logs, Docker layers, and databases.

2) Check inode usage

df -i
df -i /var

Each file consumes one inode. Maildirs, PHP sessions, and container layers with millions of tiny files exhaust inodes while df -h still shows free space. 100% in the IUse column is the smoking gun.

3) Find which mount is the problem

findmnt -D
lsblk -f

Separate /var, /home, and LVM volumes may have different utilisation. Fix the full mount, not a partition that still has room.

4) Common culprits on Debian/Ubuntu

  • /var/log/journal/ — unbounded systemd journal
  • /var/lib/docker/ — images and container layers
  • /var/spool/postfix/maildrop — mail queue backlog
  • /tmp and /var/tmp — stale temp files
sudo du -xh /var --max-depth=1 | sort -h | tail -10
sudo journalctl --disk-usage

5) Quick journal trim

sudo journalctl --vacuum-size=500M
sudo journalctl --vacuum-time=14d

Set permanent limits in /etc/systemd/journald.conf: SystemMaxUse=500M.

6) Inode investigation

sudo find /var/spool -xdev -type f | wc -l
sudo find /var -xdev -type d -empty 2>/dev/null | head

Count files per directory tree to locate inode hogs. Mail servers: check queue directories and Maildir folders.

7) Prevent recurrence

Configure log rotation, Docker log limits (/etc/docker/daemon.json with log-opts), and journald caps. Monitor both df -h and df -i in Nagios, Zabbix, or Prometheus node_exporter — alerting on bytes alone misses inode fires.

Prerequisites

Read access to mount points; sudo for cleanup commands. Know which filesystem is full before deleting — /boot filling breaks kernel installs independently of root.

Verify

df -h
df -i

Both byte and inode usage should sit below 85% on production systems with headroom for logs and updates.

Related guides

df disk space inodes