Increasing the number of inodes

If you are keeping huge number of small files in your disks, this may one day cause running out of available inodes because of which even though you might have sufficient disk space, file system cannot create new files. Lets see how it works in my 1GB disk partition.

The parameter “-i” allows us to play with the number of inodes we can have in a partition. It is called “bytes-per-inode”. The bigger it is less number of inodes you will have. I have set a relatively big size “163840” bytes per inode and the result is I have 6768 inodes. What this means indeed is I can’t create more than 6768 files. (even a bit less than this)

If you don’t believe me, lets do a test. I will mount this partition and create this number of files;

As you can see, when we can only create 6757 files and 6758. file isn’t allowed. It says no space left!! which is incorrect indeed lets have a look;

Only %4 of the disk space is in USE, the problem is more clear once you see the inode usage;

Here it is. Inode usage is %100 there is no inode left. If you set a smaller bytes-per-inode ratio, you can have more inodes. It is also worth to mention the file containing these default values with which you can play and set default values;

One thought on “Increasing the number of inodes

You have a feedback?