Sobes.tech
Junior — Middle

Is it possible to configure the number of Inodes in a Linux system, and how to do it?

sobes.tech AI

Answer from AI

The number of Inodes in Linux is determined when creating the filesystem and usually does not change dynamically. To increase the number of Inodes, you need to create a new filesystem with the desired parameter.

When creating a filesystem using mkfs, you can specify the -i parameter, which sets the byte size per Inode, affecting their quantity. For example:

mkfs.ext4 -i 16384 /dev/sdX1

The smaller the -i value, the more Inodes will be created.

If the filesystem is already created, you cannot change the number of Inodes without recreating it. Therefore, it is important to plan the number of Inodes in advance, especially for systems with a large number of small files.

To check the current Inode usage, you can use the command:

df -i

Thus, configuring the number of Inodes is only possible during filesystem creation.