← Disk & Filesystem
Linux · Disk & Filesystem
How to check inode usage in Linux
Diagnose a filesystem that is full despite free space by checking inode usage with df -i and finding directories with too many files.
A filesystem can report full while df -h still shows free space, because it has run out of inodes. df -i shows inode usage; then find the directory holding millions of small files.
# Inode usage per filesystem
df -i
# Count files per subdirectory to find the culprit
for d in /var/*; do echo $(find $d 2>/dev/null | wc -l) $d; done | sort -rn | headLinuxinodesdf