Error Codes Wiki

Linux "No Space Left" But Disk Not Full — Inode Exhaustion Fix

Warninglinux filesystem

About Linux "No Space Left" But Disk Not Full

Fix "No space left on device" when df shows available space. The inode table is full. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: Error: No space left on device (but df shows free space). Category: Linux Filesystem Error. Inodes exhausted — too many small files. Filesystem cannot create new files. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: Millions of tiny files (session files, cache). Mail queue accumulated millions of messages. Application creating many temp files. Filesystem created with too few inodes. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Check inodes: df -i. Find directories with many files: find / -xdev -printf "%h\n" | sort | uniq -c | sort -rn | head. Delete unnecessary small files. For email: clean up /var/spool/mail/. Create new filesystem with more inodes: mkfs.ext4 -N inode_count. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

What are inodes?

Each file uses one inode. The total number is set when the filesystem is created.

Overview

Fix "No space left on device" when df shows available space. The inode table is full.

Key Details

  • Error: No space left on device (but df shows free space)
  • Category: Linux Filesystem Error
  • Inodes exhausted — too many small files
  • Filesystem cannot create new files

Common Causes

  • Millions of tiny files (session files, cache)
  • Mail queue accumulated millions of messages
  • Application creating many temp files
  • Filesystem created with too few inodes

Steps

  1. 1Check inodes: df -i
  2. 2Find directories with many files: find / -xdev -printf "%h\n" | sort | uniq -c | sort -rn | head
  3. 3Delete unnecessary small files
  4. 4For email: clean up /var/spool/mail/
  5. 5Create new filesystem with more inodes: mkfs.ext4 -N inode_count

Tags

linuxlinux-filesystemlinux no space inodeubuntuterminal

More in Linux Filesystem

Frequently Asked Questions

Each file uses one inode. The total number is set when the filesystem is created.