Software⏱️ 3 min read📅 2026-06-11

How to Fix: "No space left on device" error in OpenWRT when there really is space

OpenWRT "No space left on device" error occurs despite reported low usage, likely due to limited RAM and file system fragmentation.

Quick Answer: Consider using a different file system or increasing the size of /tmp to prevent this issue.

The 'No space left on device' error in OpenWRT can be frustrating, even when there appears to be sufficient free space. This issue affects users who utilize the /tmp filesystem for temporary file storage, as it is located in RAM.

This error is particularly vexing because it suggests a lack of available disk space, which may lead users to investigate and potentially delete files without realizing that the issue lies elsewhere.

💡 Why You Are Getting This Error

  • The primary reason for this error is that /tmp is a RAM-based filesystem, meaning its storage is volatile and cannot be persisted across reboots. When the system reboots, all data stored in /tmp is lost, including files created by applications.
  • An alternative explanation is that the system's disk space usage statistics may not accurately reflect the current state of available space. This could occur if the system's file system hierarchy is complex or if there are other filesystems with limited space that are not being properly accounted for.

🛠️ Step-by-Step Verified Fixes

Clearing /tmp

  1. Step 1: To clear the /tmp directory, use the 'rm' command to delete all files and subdirectories within it: `rm -rf /tmp`.
  2. Step 2: This will remove all files stored in /tmp, including any files created by your application. Note that this action is irreversible and should be performed with caution.
  3. Step 3: After clearing /tmp, you can recreate the directory as needed using the 'mkdir' command: `mkdir /tmp`.

Increasing disk space

  1. Step 1: If you have a limited amount of free disk space on your device, you may need to increase it to resolve this issue. This can be done by expanding the root filesystem or adding additional storage devices.
  2. Step 2: To expand the root filesystem, use the 'resize2fs' command: `resize2fs /dev/mtdblock3` (assuming that's where your root filesystem is located).

✨ Wrapping Up

Resolving the 'No space left on device' error in OpenWRT requires understanding the nature of the /tmp filesystem and its limitations. By clearing or increasing disk space, you can resolve this issue and ensure that your application functions as expected.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions