FULL AI ANALYSIS

Linux reports 'No space left on device' while df -h shows plenty of free disk space — what is filling my filesystem?

Generated Nov 4, 2026, 9:38:38 AM

Analysis summary

Most likely causes: inode exhaustion on the filesystem, deleted files still held open by processes, or overlayfs/docker layer accounting causing perceived full inodes or overlay metadata growth. Each has different diagnostics and recovery paths; prefer reversible, low-impact steps first and verify by creating test files and checking df and lsof.

Possible causes

hypothesis: large files have been deleted but remain open by a process (deleted+held file descriptors), so space not released until process restart

8%

hypothesis: inode exhaustion on the ext4 filesystem caused by many small files (e.g., thousands of tiny logs, caches, or metadata files)

7%

hypothesis: overlayfs/docker metadata (overlay2) created many inode entries and exhausted per-mount inodes; df -i points to overlay mount rather than underlying block device

6%

hypothesis: a bind-mount or mount namespace hides the actual full mount, so df shows free on root but the target mount where writes occur is different and full

4%

Suggested fixes

1

Diagnostic step 1

Check inode usage per mount: run 'df -i -T' and note any filesystem with IUse% at or near 100%. Result meaning: If IUse% = 100% on the filesystem where writes fail, inode exhaustion is likely and deleting many small files (e.g., cache, tmp) or recreating FS with more inodes is required. If IUse% is low, proceed to check open deleted files.

2

Diagnostic step 2

Find large deleted files held open: run 'lsof +L1' or 'lsof | grep deleted' to list processes holding deleted files. Result meaning: If you see processes with large deleted files, their file descriptors still occupy space; restarting or gracefully rotating the service will free space. If none found, deleted-open files are unlikely.

3

Diagnostic step 3

Compare apparent sizes: run 'du -shx /var/lib/docker' and compare to 'df -h /var/lib/docker'. Also inspect overlay2 metadata counts: 'find /var/lib/docker/overlay2 -xdev -type f | wc -l'. Result meaning: If du reports much less than df, filesystem-level metadata or deleted-open files may account for the difference. Large counts of small files under overlay2 suggest inode pressure from Docker layers.

4

Diagnostic step 4

Verify the actual mount pointed at path where writes fail: run 'findmnt /var/log' and 'stat -f /var/log' to confirm the underlying device. Result meaning: If /var/log is a separate mount that is full while root is not, you need to target that mount. If it's the same device, inode or deleted-open issues are more likely.

5

Diagnostic step 5

Test creating files: as root, attempt 'touch /tmp/testfile && echo ok > /tmp/testfile' on the problematic mount and check errno and dmesg for ENOSPC or related kernel messages. Result meaning: If creation fails immediately with ENOSPC, it confirms filesystem-level resource exhaustion. If it succeeds, the issue might be specific to service user permissions, quota, or namespace differences.