“No space left on device” on a Mac: Terminal, Docker and Xcode
- It’s the system’s “disk full” error, number 28 (ENOSPC). A command or tool tried to write a file or create a folder and the file system had no free blocks left.
- First find which disk is full. It may be the Mac’s startup disk, an external drive, or a virtual disk inside Docker Desktop, which can fill up while the Mac itself has space.
- The usual fixes: free space on the Mac, run
docker system prunefor Docker, and delete Xcode’s DerivedData and unused simulator runtimes for Xcode builds.
1. What the message means
Apple’s manual page for system errors describes it as error 28, ENOSPC, Device out of space: a write to a file, or the creation of a folder, link or directory entry, failed because no more disk blocks were available on the file system. Programs print it as “No space left on device”, often after the path they were writing to.
The path in the message tells you which file system ran out. A path under your home folder or /tmp means the startup disk; a path under /Volumes/ means an external drive; an error printed inside a container or a docker build usually means Docker’s own virtual disk.
2. How to fix it
Check the Mac’s disks first:
df -h /
df -h /System/Volumes/Data
If the startup disk is the full one, free space as for “Your disk is almost full”: the Trash, large files, old installers, and developer caches you can rebuild.
Docker Desktop. All images, containers and volumes live inside one disk image file, by default ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw, with a size limit you set in Docker’s settings. Docker’s own steps:
docker system df -v
docker system prune
Add --volumes to prune only if you’re sure no volume holds data you need. Docker notes that deleting files inside a running container doesn’t give space back to the Mac by itself. Don’t move or delete Docker.raw in Finder; more on Docker’s disk image. Raising the disk limit in Docker’s settings gives the virtual disk more room; lowering it deletes the disk image and every container and image in it.
Xcode builds and simulators. Build products go to ~/Library/Developer/Xcode/DerivedData by default, which Apple calls often large and safe to re-create. Xcode › Settings › Components shows how much you can recover from platforms and simulator runtimes, and xcrun simctl delete unavailable removes simulators for runtimes you no longer have. See Xcode DerivedData and simulators.
3. If there’s space but it still fails
- It’s inside Docker: the Mac has room, but the virtual disk is at its limit. Prune, or raise the limit.
- Purgeable space: local Time Machine snapshots count as available but aren’t free until macOS removes them. Thin them with
tmutil thinlocalsnapshots / 999999999999 4; see purgeable space. - Out of inodes or a tiny volume: some disk images, RAM disks and small partitions fill quickly.
df -hshows each volume separately. - A temp folder filled up: a crashed tool can leave gigabytes in
/private/var/folders; a restart clears the parts macOS manages. See var/folders.
Questions
What does errno 28 mean on macOS?
ENOSPC, “No space left on device”: a write failed because the file system had no free blocks.
Why does Docker say no space left when my Mac has space?
Docker stores everything in one virtual disk with its own size limit. When that fills, containers and builds fail even though the Mac has room. Prune or raise the limit.
Is it safe to delete Docker.raw?
It deletes every image, container and volume in Docker Desktop. Use Docker’s own prune commands or its settings instead of deleting the file in Finder.
Is it safe to delete DerivedData?
Yes. Xcode rebuilds it; the next build of each project is just slower.
How SiftMac handles it. SiftMac’s developer files view finds DerivedData, old simulators, package caches and build folders, with a verdict on each and the real space removing it frees. It shows Docker’s disk image too, but tells you to free space inside it with Docker’s own tools rather than deleting it.
Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works