No space left on device in Terminal: find what filled the disk and free enough to continue
The error means a write failed because a disk or volume is full. How to tell which one, free enough space in minutes, and stop it recurring.
A build, install, download or Docker command stops with No space left on device, sometimes shown as ENOSPC or errno 28. The operation wanted to write, and the disk it was writing to had no room left.
1. Which disk is full?
It is not always your Mac's main disk. Check each one:
df -h| Full | Look at |
|---|---|
/System/Volumes/Data | Your Mac's disk. The rest of this guide |
| An external volume | That drive |
| A disk image or virtual disk | Its own size limit, for example Docker's |
/tmp is fine but the error persists | Inodes, or a size limit inside the tool |
2. Docker is a common one
Docker Desktop keeps everything in one virtual disk with a fixed maximum size. Inside it, space can run out while your Mac has plenty. docker system df shows what is using it, and pruning Docker frees it.
3. Free space fast
# Biggest folders in your home, including hidden ones
du -sh ~/.[!.]* ~/* ~/Library/* 2>/dev/null | sort -h | tail -15On a developer Mac, the usual heavyweights are caches that rebuild on their own:
- Xcode DerivedData. See DerivedData cleanup.
- Package caches: npm, Homebrew, Gradle, pip.
- Old
node_modulesfolders. See node_modules taking up space. - Docker images and volumes.
4. Check local snapshots
Time Machine local snapshots can hold space from files you already deleted:
tmutil listlocalsnapshots /Deleted files but storage not freed covers how to thin them.
Stop it recurring
A script that reports the biggest developer caches is in developer cleanup script. Running it monthly catches growth before the next build fails.
Common questions
What does no space left on device mean on a Mac?
A program tried to write to a disk or volume that is full. It may be your main disk, an external drive, or a virtual disk such as Docker's.
How do I fix no space left on device in Docker on a Mac?
Docker has its own virtual disk with a size limit. Run docker system df to see what fills it, then prune unused images, containers and volumes, or raise the disk limit in Docker settings.
How do I find what is filling my Mac's disk from Terminal?
Run du -sh ~/.[!.]* ~/* ~/Library/* | sort -h | tail -15 to list the largest folders in your home, including hidden ones.