How to check the Inode usage for an account in cPanel server?
Checking inode usage – cPanel/WHM
First of all, let me briefly explain about Inode. Index Node (inode) is a basic concept in Linux/Unix. Index node/number (inode) is a data structure which contain the information about a file in your server/hosting account. Inode save the information such as user and group ownerships, access mode (read, write, execute permissions) and file type.
Number of inodes indicates the number of files and folders in your account. Every file like a webpage, image file, an email, cache file etc will count as 1 inode. In a WHM server, you can view the inode usage of your account from left side of your cPanel which is denoted by the term “File Usage”.
Inode, a detailed explanation >> A short note on inode number – Linux <<
Note, this feature must be enabled from the WHM's tweak settings (Display File Usage information in the cPanel stats bar (inode count)) to display in cPanel. [Default OFF]
100% Inode usage
If your account has reached/exceeded the Inode usage and you’re not sure about the reason for this. Don’t worry. Here’s the solution for this! If the account has reached the maximum inodes allocated for your account then it’ll affect your account, website and email performance. You won’t be able to send/receive new emails, you won’t be able to upload a new file to your account. Hence it’ll affect the total performance of your account.
How to know what’s eating up the inodes?
If you have SSH access to your account the following commands will help you to understand the inode usage in your hosting account.
# find . | wc -l
This command will give you the total inode count of your account. To get the detailed inode usage that is which files/folders are consuming more inode you can use the following command.
# echo "Detailed 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"
This will give the Inode usage of your current working directory. If you need to find the Inode usage of your entire hosting account, execute this command in the location /home/user.
*Replace “user” with your username.
[[email protected] crybit]# ll total 20 drwxr-xr-x 2 root root 4096 Oct 10 10:42 test1 drwxr-xr-x 2 root root 4096 Oct 10 10:24 test2 drwxr-xr-x 2 root root 4096 Oct 10 10:42 test3 drwxr-xr-x 2 root root 4096 Oct 10 10:24 test4 drwxr-xr-x 2 root root 4096 Oct 10 10:24 test5 [[email protected] crybit]# [[email protected] crybit]# [[email protected] crybit]# echo "Detailed 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" Detailed Inode usage for: /home/crybit 5 - test1 1 - test2 5 - test3 1 - test4 1 - test5 Total: 17
How to reduce Inode usage in your account?
Here’re some suggestions to reduce the inode usage in your account.
1. Remove all unnecessary files and folders from your account.
Using FileManager you can remove unnecessary files/folders from your account.If you have the backups stored in your root directory, that is /home/user; you can download it to your local machine using FTP or FileManager.
2. Remove cache files
Certain CMS like Joomla will store lot of cached files which are used to improve the performance of your website. If there’re large amount of cache files, you can use the purge functionality to clear the cache folders. This can be done via administrator panel.
3. Archive your emails
Emails will also add inode to your account. If you’re storing all emails in the server which you think as important emails you can archive emails like emails which are older than 6 months and you can download it your local machine.
If you have enabled Default Address (catch all) for your account, you should regularly check the mailbox and clear all the unwanted emails. You need to delete all the unusing email accounts. Also you should check your email accounts and need to delete spam emails.
4. Other usage
If your account still uses large number of files you can take a look at the “Disk Usage” from cPanel.
cPanel >> Files >> Disk Space Usage
This will give you the information regarding the disk used by your account.