Why Inodes On My Server Are Running Out So Fast?

We have encounterd this situation many a times on our servers, when all the inodes are used and websites stop working. Even the WHM panel stops working. This is really bewildering situation to be in.

Why It Takes Place:
In 90% of the cases, we have found that the reason is SPAM. One of the domains hosted on your server was generating spam. That spam mesages were not delivered to the supposed email address so were being stored on the server. The volume of messages was so much that the server choked!

How to enter the server when WHM panel is not working:
You can enter the server through SSH login on command line or through parallel plesk panel (hostgator provides it with VPS hosting).

How to find the folder with excessive number of files on server:
You have to have access to the SSH console to follow the below given steps.
Also these steps apply if you are using exim4 as your mail server:

Execute the following shell commands on your server remote console.
$ cd /
$ for i in *; do echo -e “$(find $i | wc -l)\t$i”; done | sort -n

It will take sometime to display results so wait for results. It will list all the main folder along with their file counts. You can go into the folder (cd to the folder) that is found to have too many files & execute the same command again. In this way, you can narrow down on the required folder.

You will find large number of files in “input” and “msglog” folder as described here:

How to fix it?
Delete all the files inside the input folder and msglog folder:

Follow this article to know how to delete all the files from directory including sub-directories

Thats all, you will find that a large number of inodes are freed up. But be aware to block or stop the spam from the suspect website.