I have a Centos 6 server that is running kernel 2.6.32-279.19.1.el6.x86_64.

I'm experiencing an issue in which the system is hitting the max number of allocated inodes. At this moment, inode-state returns this:

# cat /proc/sys/fs/inode-state
279522  48040   0       0       0       0       0

I have 48040 inodes free, but several times per day this server will hit the limit ( it's a busy database server ).

Please, note that I'm not talking about used inodes, those defined in the file system. This is fine since when I run df -i, usage is only 14%.

How can I increase the allocated inodes limit? I saw that inode-max was removed in kernel 2.2 and couldn't find any other parameter related to this.

--- Edit ---

The used filesystem is ext4 and here is the output of df -i:

# df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda1            12804096 1783423 11020673   14% /
tmpfs                33062480      11 33062469    1% /dev/shm
  • What is the output of sysctl fs.file-nr? (# of allocated file handles, number allocated but not used and max). – Brian Sep 25 '15 at 17:32
  • @Brian Here is the output "fs.file-nr = 113024 0 7000000" – Fernando Sep 25 '15 at 17:39
  • @Iain I'm using ext4. The error in Mysql is "2002: Resource temporarily unavailable". It's solved automatically since kernel seems to clear allocated inodes ( I can see it in munin at the moment that the error happens ). – Fernando Sep 25 '15 at 17:42
  • 2
    Please remember to edit your question. Comments are only temporary, can be removed at any time, and some users don't see them. – Michael Hampton Sep 25 '15 at 17:46
  • @MichaelHampton ok, just added more info to the question. – Fernando Sep 25 '15 at 19:02

when you create ext2/ext3/ext4/ file system ,you can use -N to specify the numbers of inode exactly. once the file system created , you can't change its value. but if you use LVM , you can still add inode numbers by expanding filesystem using resize2fs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.