1

We cannot create more than 65000 sub-directories on a ext4 file systems and one suspicion we have is that the directory was created with an older version of ext4 or a different feature set.

I know how to find some basic information:

> stat .
  File: ‘.’
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d      Inode: 2           Links: 24
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-12-04 09:41:00.892098776 +0000
Modify: 2017-12-04 09:58:37.576216794 +0000
Change: 2017-12-04 09:58:37.576216794 +0000
 Birth: -

I'm interested in the more detailed ext4 flags, e.g. if the directory is linear or hash-based.

How can we view the settings of the inode, e.g. the flags?

2 Answers2

3

Use stat on the directory.

However you are actually hitting a limit of the file system and this can cause performance issues with your storage. The common solution is to partition your namespace in a more structured way, or, depending on what your requirements are, a more flexible filesystem such as xfs, zfs or btrfs.

1

With the tool debugfs I was able to extract some more information:

> sudo debugfs /dev/sda1
> stat /
Inode: 2   Type: directory    Mode:  0755   Flags: 0x80000
Generation: 0    Version: 0x00000000:0000002f
User:     0   Group:     0   Size: 4096
File ACL: 0    Directory ACL: 0
Links: 25   Blockcount: 8
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x5a2520d3:c43db60c -- Mon Dec  4 10:17:55 2017
 atime: 0x5a2520fb:98591bd8 -- Mon Dec  4 10:18:35 2017
 mtime: 0x5a2520d3:c43db60c -- Mon Dec  4 10:17:55 2017
 crtime: 0x59f78ef9:00000000 -- Mon Oct 30 20:43:37 2017
Size of extra inode fields: 28
EXTENTS:
(0):140

And for determining if a directory is linear or hash-based (I guess one could also parse the flags above):

> sudo debugfs /dev/sda1
> htree /
htree: Not a hash-indexed directory