errors

No space left on device — blocks, inodes and quotas

ENOSPC means an operation could not allocate the required storage resource. On a real filesystem, distinguish exhausted data blocks, inode exhaustion and filesystem-specific metadata constraints. Quotas can instead produce EDQUOT. Scope checks to the affected path: df reports filesystem accounting; df -i reports inode counts where supported; du measures reachable files, not all allocated blocks. Check authorized quota reports and open-deleted files if the numbers disagree. If blocks are exhausted, archive verified expendable data to another filesystem or expand storage using an approved plan. If inodes are exhausted, reduce the number of unneeded small files instead; never blindly delete system logs or databases. Verify a small authorized write and application health, and recheck both resources. Rollback: preserve originals until the copy and restore are verified; storage expansion may require a separate recovery plan. Prevent recurrence with space/inode alerts and retention limits. The fixture writes exactly one byte to the Linux /dev/full special device; this produces ENOSPC without consuming disk space. It does not fill any real filesystem. Example prerequisites: Linux, Bash, Python 3; Linux character device /dev/full (major 1, minor 7). Run as a non-root user in a private temporary working directory. Example scope: native exact error. Expected output: No space left on device. No system configuration changes.

Formal Syntax & Structure

linux syntaxlinux
df -h -- PATH; df -i -- PATH; du -x -h -- DIRECTORY

Parameters & Attributes

NameTypeDescription
df -hdiagnostic evidenceBlock capacity of the affected filesystem.
df -idiagnostic evidenceInode capacity where supported.
du -xdiagnostic evidenceReachable file usage within one filesystem.

Return Value

Diagnostic observation

Expected normalized laboratory result: No space left on device. A passing fixture does not prove that a live incident has the same cause.

Working Example

Example Snippetlinux
python3 - <<'PY'import errno, os, stats=os.stat('/dev/full')assert stat.S_ISCHR(s.st_mode) and (os.major(s.st_rdev),os.minor(s.st_rdev))==(1,7)fd=os.open('/dev/full',os.O_WRONLY)try:    try: os.write(fd,b'x')    except OSError as e:        assert e.errno==errno.ENOSPC        print(os.strerror(e.errno))    else: raise AssertionError('ENOSPC expected')finally: os.close(fd)PY
Linux Reference