How to check inode usage on linux for a specific cpanel user account or directory

If you’re a linux system administrator you’re probably already familiar with the term “inode”.  For those of you who are not, an inode is basically a way to measure the amount of files a user has.  This includes every email, cache file, image, and so on.  If it has a filename it is considered an inode.  Normally hosts will use this as a way to determine clients that need to be removed from backups because of the IO load they put on the server from the amount of inodes they have.

A few ways to measure this are…

Using the script I created and posted on GitHub:
https://github.com/tripflex/inodes

Or …

Current Directory

Navigate to the users directory you want the inode count for

Now use this echo code below and you should get something similar to the output you see right below it.

Here’s what it should like like after executing it:

In the example above we have 34,379 inodes under theuser’s account.

Coming Soon

I’ll write a script soon to incorporate something similar to this to automatically remove users from backups and send an email when it goes over specified limit.

Wikipedia

http://en.wikipedia.org/wiki/Inode

Myles

Orlando, FL

Did this post help you?

Give back and rate it for me!

Related Posts

  • Thanks, it worked well for me to check the iNodes of an account on my vps. Is there a way we can display the total iNodes value in cpanel or create an email alert on reaching maximum inode limit.

    • That’s actually not a bad idea…one thing you could do is use the bash script I created for this and set it up as a cronjob and just have it email if total count is over a specific number.

      Here’s the script on GitHub:
      https://github.com/tripflex/scripts/blob/master/checkinodeusage

      I’ll think about this though, it would probably be nice to have that as an added feature in customer’s cPanel so they know how many inodes they are using.