Problem: after enabling the ext4 large_dir
option I want to know if it's used and/or whether I need to recreate directories for it to be used.
Detail: I have directories that on occasion can hold millions of files. I ran into:
[ma jan 11 01:37:22 2021] EXT4-fs warning (device nvme1n1): ext4_dx_add_entry:2349: Large directory feature is not enabled on this filesystem
[ma jan 11 08:42:21 2021] EXT4-fs warning (device nvme1n1): ext4_dx_add_entry:2345: Directory (ino: 11010158) index full, reach max htree level :2
So, I enabled large_dir
:
tune2fs -O large_dir /dev/nvme2n1
tune2fs -O large_dir /dev/nvme1n1
Now, how can you tell it's used? lsattr -d
shows nothing new:
# lsattr -d 0 1 2 ../corrupt_2012
-----------I--e--- 0
-----------I--e--- 1
-----------I--e--- 2
-----------I--e--- ../corrupt_2012 # Culprit with inode 11010158. It's been re-created after adding `large_dir`
The attributes I
and e
are 'index based on hashed trees' and 'extents'. Neither of those is new, and also appears on other disks/servers.
So, how do I know whether to recreate the directories?