Free ops runbook · Linux

Disk full and inode exhaustion: find the consumer before you delete anything

The site is down, df says 100%, and the first instinct is to delete files. The first move is to find out whether it is bytes, inodes, or a deleted file still held open by a process.

Bytes vs inodes

df -h shows bytes; df -i shows inodes. A filesystem can be out of inodes with free space.

Deleted but open

A process still holds the file descriptor after rm; space is not freed until the process restarts or closes it.

Journal and containers

journalctl and Docker logs are the usual consumers, not the application database.

Safe cleanup order

Rotate/vacuum logs, then prune unused images with a dry run, then investigate the application. Never delete a database file to make space.

Detect

Commands, in order

CommandWhat it finds
df -h; df -iWhich filesystem and whether it is bytes or inodes.
du -x -h --max-depth=1 / | sort -hTop-level consumers without crossing mounts.
lsof +L1Deleted files still open by a process.
journalctl --disk-usageJournal size before vacuuming.
docker system dfImages, containers, volumes and build cache.
Cleanup

Safe order

1. Logs

journalctl --vacuum-size=500M, logrotate, or truncate an open log with : > file.

2. Container leftovers

docker system prune --dry-run first; never prune volumes you have not identified.

3. Application data

Move old backups or exports off the volume; do not delete the live database.

4. Prevent

Alert at 80% and 90%, on inode usage, and on log growth rate — not only on 100%.

Keep going

This page is free. The paid runbooks cover the operational failures around it, with detection commands, five failure modes and a migration checklist.