Shared server guidance · Question & answer

Why does Linux say no space left when disk gigabytes are still available?

A filesystem can exhaust its inode capacity while still having free data blocks, especially when an application creates many small files. The exact behaviour depends on the filesystem. Check inode usage, quotas and the reported error before deleting anything or adding disk capacity.

IntermediateLinux VPS and dedicated servers with GNU utilities
Go to the answer

Before you start

  • An authorised SSH session on the Linux server.

Instructions

1. Compare block and inode capacity

Query the same path in both commands so you are comparing the same mounted filesystem.

Remote Linux shell
df -h /var
df -i /var

-i reports inode counts where supported. Near-zero free inodes can explain new-file creation failures despite free gigabytes.

2. Locate the responsible directory cautiously

Inspect the application’s cache, session, queue or temporary-file retention using its own tooling first. When a filesystem scan is needed, keep it within the affected application path and avoid following unrelated mounts.

Remote Linux shell
sudo du --inodes -x --max-depth=1 /var

GNU du counts inode use within this filesystem. Run only within the authorised scope, and investigate permission or I/O errors before treating the summary as complete.

Check the result

  • The failing path’s inode availability and the responsible file-growth pattern are identified. Use application-supported retention or cleanup after approving the exact data scope.

Troubleshooting

Inode counts look healthy
Check user/project quotas, reserved blocks, tmpfs limits and read-only filesystem errors.
A cache has millions of files
Address the retention or generation problem; deleting arbitrary directories can disrupt active requests or queues.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.