If your inode space is full in your cPanel/WHM server then follow below steps to clear the usages.
First, execute the below command it will show the total files count along with the folder path.
sudo su -
echo "Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
In my case, /root/.cpanel/datastore folder was taking huge inode space. Normally, cpanel caches quota and some other info in this folder, but most of the files are in the form below (Cpanel::Net::Whois::IP::Cached_XXX.XXX.XXX.XXX). It is safe to delete those files only.
I’m going to delete files which is older than 30 days.
find /root/.cpanel/datastore/Cpanel::Net::Whois::IP::Cached_* -type f -mtime +30 -exec rm {} \;
OR
If you face below error.
“ /usr/bin/find: Argument list too long” then execute like below command.
ls | head -n1000
find /root/.cpanel/datastore/Cpanel::Net::Whois::IP::Cached_145.* -type f -exec rm {} \;
Now again verify with the below command.
df -i
Comments