How to remove excessive inodes

This article will show you how to clear your directories within a Virtual Private Server.

If you’re running out of disk space on your server, this could be due to a large amount of inodes on your server. These contain important information about your files, including their types and ownership. For details on how to remove inodes from your VPS, please follow the instructions outlined below.

Please note: the following article was originally created for our current generation of Virtual Private Servers. As such, these instructions may not be relevant to our previous generation of Virtual Private Servers.

Important: you will need to enable admin access to your server to perform this action. As such, we only recommend that advanced users undertake this action as changes to your system files are irreversible and can cause your associated websites to go offline.

Do not remove files from the /home/virtfs directory, since this doesn’t actually use disk space.

Step 1 of 5

Start by logging in to your server via SSH.

Step 2 of 5

Next, you will need to switch to the root user.

Step 3 of 5

Access the directory that you need to clear by using the cd command.

Step 4 of 5
  • From there, you can enter one of the following commands:
find /path/to/directory -type f -exec rm -f {} \;Remove all files within a directory
find /tmp -type f -mtime +14 -exec rm -f {} \;Search for and remove specific files that are older than 14 days
find /var/cpanel/php/sessions/ea-php73 -type f -name ‘sess*’ -exec rm -f {} \;Remove files that use the naming convention ‘sess_{randomstring}’
find /var/cpanel/php/sessions/ea-php73 -type f -mmin +30 -name ‘sess*’ -exec rm -f {} \;Remove all files that are older than 30 minutes
rm -rf /path/to/directoryRemoves a directory and its contents


Step 5 of 5

Once you’ve done this, restart your server.