Inodes are one of those things we rarely talk about unless their use becomes a problem. They’re fundamental bits of a file system that quietly do their job without any intervention from us. But there may be occasions when you need information about your account’s inode use.
This article will:
- Show you where to see how many inodes your account is using.
- Explain what inodes are.
- Explain when inode use can be a problem.
- Talk about inode quotas or limits.
- Show you how to reduce your usage if you’re approaching (or exceeding) your account limit.
Where to See Your Inode Usage
At GreenGeeks, you’ll notice the inode term is replaced with “File Usage.” That’s because they are essentially one of the same thing. We’ve just simplified the terms to make it easier for some of our customers.
If you need to know your current usage, you can:
Easy Method: Check cPanel
You can see how many inodes your GreenGeeks account is using in cPanel.
In the “Statistics” section in the right column, look for “Inodes.”
The first number is the total number of inodes currently used. The second is your account’s overall inode quota.
Note that the number of currently used inodes is cached, and may not reflect the correct value if you’ve recently added, or removed, a large number of files.
In the above example, 130,720/600,000 means we are using 130,720 inodes right now, and our overall limit is 600,000 total.
Inode Calculation Tool
cPanel Statistics will only show an overall value, for a more in-depth, folder-by-folder summary as available using the Inode Usage tool under the Files section of cPanel.
The Inode Calculation Tool generates a folder-by-folder listing for all folders with more than 1000 inodes; some system folders are excluded by default.
Scroll down to the end of the Inode Calculation Tool to see your output; this may take a few moments to generate for large accounts.
If your account is above the assigned inode quota, you’ll need to use the CLI inode tool over SSH/cPanel Terminal as the cPanel-based Inode Calculation Tool will be unable to create the necessary temporary files.
Advanced Method: Shell Commands on the Server
If you want more details about inode usage, you can log in to the server and run commands that display inode counts.
First, make an SSH connection, or open the Terminal directly in cPanel.
To see the total number of inodes used, run this command:
By default, the inodes command will show the results for all sub-directories within the current working folder. This output is never cached and will always reflect the correct value based on your usage.
Optional Config Flags
The inodes command has two optional configuration flags that allow you to further refine the results based on the directory or the number of inodes.
The -e flag allows you to exclude directories below the value specified
The -d flag runs the scan on a specific directory, instead of the current working directory.
Any enabled config flags will be listed at the top of the output.
Optional Flags Example
As an example, if I only wanted to review folders within the
~/public_html/ directory, and only those with more than 1000 inodes, I would use the following command:
inodes -e 1000 -d ~/public_html
What Is an Inode?
Inodes represent objects in the file system. Think of them as tiny index files.
When you upload a file to your website (or to any disk or solid-state drive), the data that makes up the file is stored in multiple blocks. Those blocks aren’t always arranged in neat groups. They can be scattered across different areas of the disk.
The inode contains instructions that let the file system know where to locate the data on the disk. It also includes some other information, or metadata, about the file.
When Can Inode Use Become a Problem?
The quick answer is that there are a limited number of inodes available in any file system. Every file on the system has a corresponding inode. A huge file uses a single inode in the file system, but a tiny file also uses one inode.
A website that’s designed to generate or use many small files may not seem like a problem. After all, hundreds of thousands of tiny files take up very little storage space, right? They take up very little physical space, yes, but they consume a large number of inodes.
Inode Limitations Are in Place to Prevent Server Problems
Since the total number of inodes for the file system is limited, individual file system users (or web server users) have to be limited in how many they can create. If there were no limitations, a single user on the server could use all the available inodes while using relatively little storage space.
For the same reason, a hosting account may reach an inode limit before it reaches a storage space limit. To prevent a single user on a server from consuming all the available inodes, quotas are in place.
Inode quotas aren’t specific to GreenGeeks. Every shared hosting provider imposes per-user inode use limits.
How to Reduce Inode Usage
The only way to reduce inode use is to reduce file use. When you delete a file, its inode is deleted as well. So here are a few ways to reduce your inode use.
1. Delete Unused Files
The first way to reduce inode/file use is the simplest – delete unused files from your account. Some of the major culprits here are unused CMS installations. Many of us will install WordPress, Joomla, Drupal, or another CMS to give them a try. If we decide not to use them, we don’t always delete the installations.
Most CMS packages contain hundreds—if not thousands—of files, so deleting them can reduce file use. As a bonus, older versions of CMS can be targets for hackers, so removing unused installations improves your website security.
2. Use Cloud File Storage
The second most effective method is to consider external file storage. Google, Amazon, and Microsoft all have cloud file storage systems, as do hundreds of other companies. If your site uses a lot of small files that can be stored on another server, such as images or documents, remote file storage can help lower your website file count.
The difficulty in setting up a site to use remote file storage varies depending on how your website is configured, and whether you use a CMS. But the benefits can outweigh the setup costs.
3. Check Your Email
Finally, something that’s often overlooked when it comes to inode use is email. Your account’s inode quota includes all the files related to your account. That means not only website files but email as well.
If you can purge older emails or large spam folders, etc., you can free up a lot of inode space.
If you have any questions that we haven’t answered, please feel free to contact our support team.