Help

Running Out of Inodes

Inodes, also known as index nodes, are data structures in Unix operating systems that store information about files and directories. In effect, inodes are metadata, since they contain information about files and directories.

Inodes store various file attributes, such as size, owner, group, permissions, number of hard links, location of the file's data blocks, and timestamps such as the time of last modification, last access, and more. In other words, inodes contain all information about a file except its name and its actual contents.

The more files are created, the more inodes are needed. An excess of files, such as cache files or mail queues, can exhaust the available inodes and cause errors on the server, as well as messages about running out of disk space, even if there is actually free space on the disk. To fix this problem, you need to delete unnecessary files or directories.

To get information about the number of used and available inodes when connected over SSH, run the following command:

df -hTi

Values in the command output:

  • Inodes — the total number of inodes on the file system;
  • IUsed — the number of used inodes;
  • IFree — the number of available inodes;
  • IUse% — the percentage of inodes in use.

Running Out of Inodes

To solve the problem of running out of available inodes, delete unnecessary files or directories to free up inodes.

To find directories that contain a large number of files, run the following command:

echo "Detailed 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"

Unnecessary files and directories can be deleted with the rm command, but be careful not to delete important data by accident.

Have more questions about Hosting?