Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article3 min readViews3

Free Gigabytes Are Available, But the File Won't Create: Check Inodes

We analyze the situation where Linux reports no space despite free disk capacity: how to check inodes and find directories with a high number of files.

Organizer with many small electronic fasteners
In this article

A lack of space error does not always mean gigabytes are exhausted. File systems use service records called inodes to store files. When available records are exhausted, a multitude of small files can stop writing before the disk volume is filled.

Check the path where the error occurs

This guide applies to Linux with GNU Coreutils. The examples use /var. Substitute the directory where the application cannot create a file: checking the home directory does not replace checking a separate volume with mail or cache.

df -h /var

df -i /var

The first command shows data blocks, the second shows inodes. Look at the available amount and usage percentage. Some file systems manage inodes differently and do not display the familiar fixed limit. Therefore, dashes or unusual values must be analyzed considering the volume type, not treated as proof of correctness.

Look for the count, not just the size

A large video file and a million small files place different loads on metadata structures. To find the branch with a large number of records, GNU du can count inodes:

du --inodes -x -d1 /var

The check is limited to one file system and outputs the first level of directories. You can then repeat it inside the suspicious branch. Traversing a directory with a huge number of files can take time and load the storage; do not run it cyclically every second.

If the output contains an access denial, part of the tree was not counted. Discuss the required access with the administrator. The absence of a catalog in the final list due to read errors does not mean it is empty.

Typical scenario

Suppose the application creates a new session file every time and never deletes expired ones. The total size remains moderate, but the number of objects continuously grows. Deleting several large archives will free up blocks, but it will hardly change the inode situation.

Another example is a mail queue. Here, mass deletion of files can destroy messages that still need to be delivered. First, you must determine the purpose of the directory and the standard mechanism for processing expired objects. The name "temporary" does not automatically make data unnecessary.

How to verify the fix

Record the diagnostic result as a set: path, file system, free inodes, the directory with the highest number of records, and the owning application. After agreed cleanup, repeat df -i and verify the normal operation of the application that previously ended with an error.

Then compare the metrics over a working interval. If free records disappear again quickly, you need to adjust the retention period or queue processing. Increasing disk space is not a universal solution: the ability to increase the number of inodes depends on the file system and the method of its expansion.

Do not change limits or schedule recursive deletion. A stable result requires a clear answer: which files are created, how long they must be retained, and who controls the completion of cleanup. In monitoring, it is useful to track free blocks and free inodes separately, as these two metrics answer different questions.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.