How to Manage the Inode Count

July 4, 2024 / How-to Guide

In this article, you will explore how to manage the Inode count. An Inode is a data structure in a file system that stores metadata about a file or directory, such as permissions, ownership, and timestamps, but not the file name or its actual data.

First, let us understand how to determine the Inode count:

Now, this process completely depends on the type of hosting package that you have:

  1. If you have a shared or reseller hosting package, you can use cPanel or the command line to check your current inode usage.
  2. For other types of hosting packages, including managed VPS, managed dedicated servers, and all unmanaged packages, you must use the command line to determine inode usage.

Method1- Use cPanel
To determine the current inode count using cPanel, follow these steps:

  1. Access your cPanel account.
  2. In the “Statistics” section on the cPanel home page, find the “File Usage” row.
  3. The first number shows the number of inodes currently used by your account, while the second number shows the maximum allowed inodes.
  4. For example, the image below demonstrates an account utilizing 94,620 Inodes out of a permitted 100,000.
    file usage

Method2- Use the command line
To determine the present inode count for directories in your account using the command line, follow these steps:

  1. Log in to your account using SSH.
  2. To ensure you are in your home directory, type the following command:
    cd ~
  3. To determine the total Inode count for your account, type:
    find . | wc -l

    Note: If your account contains a large number of files and directories, this command may take some time to complete.

  4. To view a breakdown of Inode usage for all directories in the current directory, type:
    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”

The command in step 3 displays the total Inode usage for your account, while this command shows the inode count for each top-level directory. To view the inode usage for a specific subdirectory, navigate to that directory (e.g., type cd public_html) and rerun the command. You can repeat this process to delve into subdirectories and pinpoint where your account is consuming the most inodes.

This way, you can manage the Inode count. Hope you liked our article. However, if you face any difficulty, feel free to contact our support team. They will surely help you.

Learn how to find out server disk space usage in our guide: How to Find out Server Disk Space Usage.

Spread the love