Interview Prep/Linux/Disk space, inodes and filesystems

Disk usage on `/tmp` keeps growing and `du` shows a few huge files named like `/tmp/php*` or `/tmp/sort*`.

IntermediateTroubleshootingDisk space, inodes and filesystems
Answer

Likely causes → Applications or tools (sort, uploads, DB temp files) writing big temp files and not cleaning up, or crashing mid-way.

Diagnose →

sudo du -ah /tmp | sort -h | tail
sudo lsof +D /tmp | head
systemctl status systemd-tmpfiles-clean.timer

Fix → Remove files not held open; set TMPDIR for big jobs to a dedicated volume.

Prevent → Make sure systemd-tmpfiles-clean.timer runs with an age rule (/usr/lib/tmpfiles.d/tmp.conf), or mount /tmp as size-limited tmpfs.

All Linux questions Roadmap: Linux

More on Disk space, inodes and filesystems