Linux中报 Directory index full 的错误解决办法

背景

1Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2461: Directory (ino: 4230742) index full, reach max htree level :2
2Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2465: Large directory feature is not enabled on this filesystem
3Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2461: Directory (ino: 4230742) index full, reach max htree level :2
4Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2465: Large directory feature is not enabled on this filesystem
5Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2461: Directory (ino: 4230742) index full, reach max htree level :2
6Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2465: Large directory feature is not enabled on this filesystem
7Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2461: Directory (ino: 4230742) index full, reach max htree level :2
8Mar 28 15:24:01 mimi kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry:2465: Large directory feature is not enabled on this filesystem

网上查了一下

This error means you're hitting the max h-tree size, and don't have large_dir enabled

大概的解决办法就是把large_dir enable

1> tune2fs -O large_dir /dev/sda3 
2tune2fs 1.46.5 (30-Dec-2021)

错误消失