Intermediate LevelLinux Commands & SysAdmin
What is an Inode and what happens when a Linux filesystem runs out of free inodes (df -i)?
❓ Interview Prompt: Explain Inodes (index nodes), file metadata storage, checking inode usage (df -i), and inode exhaustion troubleshooting.
An Inode (index node) is a data structure on Linux filesystems that stores metadata about a file (permissions, owner, size, timestamps, data block pointers) EXCEPT its filename.
Inode Exhaustion Issue:
Every filesystem has a fixed maximum number of inodes created during formatting. Creating millions of tiny 0-byte files can exhaust free inodes ('df -i' shows 100% full), preventing new file creation even if 'df -h' shows gigabytes of free disk space!
Code Implementation Example
bash
# Check inode usage across filesystems
df -i
# Find directory containing millions of tiny files consuming inodes
find /var/spool -type d -exec sh -c 'echo -n "{} "; ls -1 "{}" | wc -l' ;💡Diagnosing inode exhaustion using df -i and counting directory file handles.
🎯 Interview Key Takeaway
Use df -i to diagnose filesystem write failures caused by inode exhaustion when free disk space remains.
#Inodes#Filesystem#df -i#Debugging#Intermediate
Back to all Linux Commands & SysAdmin Questions→