Remove excessive inodes
Disk space issues can be caused by large files or too many inodes. Inodes store information about files and directories (folders), such as file ownership, access mode (read, write, execute permissions), and file type. The maximum number of inodes, like disk space, is set when the server is created.
If you have not yet found areas of high inode use, see find inode usage.
Do not attempt to remove files from the /home/virtfs directory. This directory is a virtual file system used by WHM/cPanel and doesn't actually use disk space.
- Enable administrator access on your Gen 3 or Gen 4 server if you haven't already done so.
- Connect to my server with SSH (Secure Shell).
- Switch to the root user.
- Use cd to move into the directory with the inode issue before running any commands to remove files.
- There are several ways to remove multiple files. The following are a few common methods.
If you run a command and receive an error like /bin/rm: Argument list too long, you will need to be more specific with your command (ie. files older than 14 days instead of all files).
To remove all of the files within a directory:
find /path/to/directory -type f -exec rm -f {} \;
Use -mtime to search for and remove specific files older than 14 days:
find /tmp -type f -mtime +14 -exec rm -f {} \;
Use -name to remove files that use the naming convention 'sess_{randomstring}':
find /var/cpanel/php/sessions/ea-php73 -type f -name 'sess*' -exec rm -f {} \;
Use -mmin to remove all files older than 30 minutes:
find /var/cpanel/php/sessions/ea-php73 -type f -mmin +30 -name 'sess*' -exec rm -f {} \;
To completely remove a directory and all of it's contents (use with extreme caution):
rm -rf /path/to/directory
- Reboot your Gen 3 or Gen 4 server.
Next steps
- Return to Disk Space Audit
- It's important to identify and correct the root issue that caused the disk space to become exhausted. Move on to preventing disk usage issues.
More info
- Our server experts can perform these steps for a fee. For more information about our Expert Services, please visit our Expert Service menu