Recently we had a problem where one of the ext4 file-systems seemed unable to handle very large number of files, more than 6mln in this case
, in spite of having enough space. Is it 6mln
the max number, an ext4 file-system can have when formatted with all the default settings? I tried to Google it but didn't get any definitive answer. Anyone one out here can shade some light on this please? Cheers!!
There is no default as such for ext4, it depends on the size of the device and the options chosen at creation. You can check the existing limits using
For example,
As per
man mkfs.ext4
It depends how you formatted the filesystem. Using
tune2fs -l <device>
you can find the number of inodes your device has, probably around 6 million inodes in your case. Every file or directory uses an inode.As far as I know, the only possibility to increase the number of inodes is to re-format your filesystem. The
-i
parameter to themkfs
can be used to specify the bytes/inode ratio. The default value is defined in/etc/mke2fs.conf
(on my system: 16384).A larger bytes/inode ratio defines fewer inodes, a smaller one more inodes. The default values works well in most cases, but if you have a large number of small files, you may run into the limit and may need to format the filesystem with a smaller bytes/inode ratio.