Interview Prep/Linux/Disk space, inodes and filesystems

A database server shows `EXT4-fs warning: ext4_dx_add_entry: Directory index full!` and inserts start failing.

AdvancedTroubleshootingDisk space, inodes and filesystems
Answer

Likely causes → A single directory has reached the ext4 htree limit (millions of entries).

Diagnose →

dmesg -T | grep -i 'index full'
sudo find /data -xdev -type d -exec sh -c 'echo "$(ls -f "$1" | wc -l) $1"' _ {} \; | sort -rn | head
sudo tune2fs -l /dev/sdb1 | grep features

Fix → Move files into subdirectories. On newer kernels you can enable large_dir: tune2fs -O large_dir /dev/sdb1 (check kernel and e2fsprogs support first).

Prevent → Application-level directory sharding; alert on directory entry counts.

All Linux questions Roadmap: Linux

More on Disk space, inodes and filesystems