On Linux, a portion of the filesystem is dedicated to inodes. An inode is a data structure that describes a file or a folder. It includes things like the owner, the group, permissions, file size, created/modified/access timestamps, and more.

To check how many inodes are in use and free, use  df -i .

The number of inodes on a filesystem is fixed; it’s possible to run out of inodes without running out of disk space. (e.g., a 1GB disk that has a million empty files.) This is the kind of scenario needed to exhaust the number of inodes.

Running out of inodes can be confusing because the errors all indicate disk space is the issue — even when you have plenty of disk space to spare.


EFFECTS


The moment a file system runs out of inodes, all new files and folders will be rejected. Until that point, no adverse affects will manifest. Once inodes are 100% used, you’ll begin to notice:

  • Data loss
  • Applications crashing
  • OS restarting
  • Processes don’t restart
  • Periodic tasks not firing

When you run out of inodes, you’ll need to find the location and source of all the small files to fix it.

 

QUICK FIX


Find the directory containing all the small files. Research their origin and value and delete if appropriate.

 
 

THOROUGH FIX


If you are legitimately running out of inodes because your use case requires many small files, you will have to recreate your filesystem with special options to increase the number of inodes. The number of inodes in a filesystem is static and cannot be changed.


RESOURCES