Skip to content

Grading Checklist

  • Uses df -i to identify inode exhaustion as the root cause.
  • Explains the difference between disk space and inodes -- many small files can exhaust inodes while leaving plenty of space.
  • Locates the directory containing millions of files using find with -maxdepth or for d in /*/; do echo "$d: $(find "$d" -maxdepth 1 | wc -l)"; done.
  • Identifies the cron job or process responsible for creating the files.
  • Provides a safe method to delete millions of files without overwhelming the system (e.g., find ... -delete or rsync --delete).
  • Warns against using rm -rf on a directory with millions of files (argument list too long, shell glob expansion).
  • Recommends implementing a cleanup cron job to remove files older than N days.
  • Notes that ext4 inode count is fixed at filesystem creation and cannot be changed without reformatting.
  • Mentions that XFS dynamically allocates inodes and is less susceptible to this issue.
  • Recommends monitoring inode usage alongside disk space in the alerting system.
  • Suggests using a database or single file (append-based) instead of one file per event.