System: CentOS; a generic Linux system can also be used this way.
Situation Description: Today our mail server can not send and receive mail, and connect to the server on the open service is not open, starting to think that the disk space is not enough, DF looked at a bit
Find the space is sufficient, and then df-i view the next inodes, found that the root directory inodes value usage is 100%
Workaround: Check with the following script to see in which directory the most files are below:
For i in/*; do echo $i; Find $i | Wc-l; Done (if determined to be under a directory, then/converted to the directory absolute path, such as/var/spool, use for I in/var/spool/*; do echo $i; Find $i | Wc-l; Done
The/VAR/SOPPL directory was eventually found to be the most. And then further determined that there are millions of files under the/var/spool/amavisd/quarantine directory, the machine has been unable to display the normal, and then Baidu looked under this directory is the mail server, processing spam live virus mail quarantine, understand why, delete all of the directory Use the Xargs command to delete a larger number of files:
ls | Xargs-n RM-RF
After about more than 10 hours of execution, the problem is finally resolved.
About the problem of inodes occupancy 100% and how to solve it