Interview Questions/Troubleshooting Scenarios/Inode Exhaustion on Filesystem
IntermediateScenario
10 min

Inode Exhaustion on Filesystem

LinuxStorageOperations
Advertisement
Interview Question

Disk usage looks low, but new files cannot be created and services fail with ENOSPC. How do you confirm inode exhaustion and fix it?

Key Points to Cover
  • Confirm with df -i; identify directories with many small files
  • Clean up temp/cache directories and rotate logs
  • Bundle small files, adjust app temp file behavior
  • Consider filesystem with higher inode density or reformat
  • Add alerts on inode utilization
Evaluation Rubric
Detects inode exhaustion precisely30% weight
Finds directories causing inode pressure30% weight
Applies cleanup and longer-term solutions20% weight
Adds monitoring to prevent recurrence20% weight
Hints
  • 💡Look for per-user caches and build artifacts.
Common Pitfalls to Avoid
  • ⚠️Assuming low disk space percentage means no inode issue, overlooking `df -i`.
  • ⚠️Performing blanket `rm -rf /` or similar destructive commands without first identifying the specific directories consuming inodes.
  • ⚠️Not understanding the impact of small, numerous files on inode consumption.
  • ⚠️Ignoring application-specific file creation patterns and focusing solely on system-level cleanup.
  • ⚠️Failing to implement or regularly check log rotation configurations, leading to recurring log file inode issues.
Potential Follow-up Questions
  • How to design apps to avoid inode issues?
  • Would object storage help?
Advertisement