If I create a small filesystem, and grow it when I need to, will the number of inodes increase proportionally?

I want to use Docker with the overlay storage driver. This can be very inode hungry because it uses hardlinks to merge lower layers. (The original aufs driver effectively stacked union mounts, which didn't require extra inodes, but instead caused extra directory lookups at runtime). EDIT: hardlinks don't use extra inodes themselves, I can only think the issue is extra directories which have to be created.

(Closed question here. I believe the answer is incorrect. However it says the question is closed, and that I need to create a new one).

1 Answer 1


Yes. See man mkfs.ext4:

-i bytes-per-inode

Specify the bytes/inode ratio. mke2fs creates an inode for every bytes-per-inode bytes of space on the disk. The larger the bytes-per-inode ratio, the fewer inodes will be created. This value generally shouldn't be smaller than the blocksize of the filesystem, since in that case more inodes would be made than can ever be used. Be warned that it is not possible to change this ratio on a filesystem after it is created, so be careful deciding the correct value for this parameter. Note that resizing a filesystem changes the numer of inodes to maintain this ratio.

I verified this experimentally, resizing from 1G to 10G and looking at tune2fs /dev/X | grep Inode. The inode count went from 64K to about 640K.

I believe it's a natural consequence of Unix filesystems which use "block groups". The partition is divided into block groups, each of which has their own inode table. When you extend the filesystem, you're adding new block groups.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .