ErrorKind::StorageFull
RustERRORCommonI/O

No space left on device

Quick Answer

Free disk space, write to a different volume, or implement disk-usage checks.

What this means

The underlying storage device has no remaining space to complete the write operation.

Why it happens
  1. 1Disk quota exceeded
  2. 2Logging loop filling the disk
  3. 3Large temporary files not cleaned up

Fix

Check free space before writing

Check free space before writing
// Use the fs2 crate for cross-platform free space:
// let free = fs2::free_space("/var/data")?;
// if free < required_bytes { return Err(...); }

Why this works

Proactively checking space prevents partial writes and corrupt files.

Code examples
Noterust
// Unstable: ErrorKind::StorageFull added in Rust 1.83
Same error in other languages
Sources

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Rust errors