# “No space left on device” on a Mac: Terminal, Docker and Xcode

Error message · Updated 24 November 2026. By Mohit Nippanikar, who makes SiftMac.

## The short answer

- **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 prune` for 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”](https://siftmac.com/errors/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](https://siftmac.com/safe-to-delete/docker-raw). 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](https://siftmac.com/guides/xcode-deriveddata) and [simulators](https://siftmac.com/safe-to-delete/xcode-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](https://siftmac.com/guides/purgeable-space-on-mac).
- **Out of inodes or a tiny volume:** some disk images, RAM disks and small partitions fill quickly. `df -h` shows 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](https://siftmac.com/safe-to-delete/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: https://siftmac.com/SiftMac.dmg (scanning is free, and so is the first 2 GB of cleaning).

## Sources

- [Apple: intro(2) manual page, error 28 ENOSPC](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/intro.2.html)
- [Docker: Desktop settings](https://docs.docker.com/desktop/settings-and-maintenance/settings/)
- [Docker: FAQs for Docker Desktop for Mac](https://docs.docker.com/desktop/troubleshoot-and-support/faqs/macfaqs/)
- [Apple: Downloading and installing additional Xcode components](https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components)

## Related

- [Is it safe to delete Docker.raw?](https://siftmac.com/safe-to-delete/docker-raw)
- [Is it safe to delete Xcode’s DerivedData folder?](https://siftmac.com/guides/xcode-deriveddata)
- [Is it safe to delete Xcode simulators and CoreSimulator?](https://siftmac.com/safe-to-delete/xcode-simulators)
- [Xcode DerivedData, node_modules and Docker: what’s safe to delete on a developer’s Mac](https://siftmac.com/guides/developer-files-on-mac)
- [“Your disk is almost full” on a Mac: what it means and what to do](https://siftmac.com/errors/your-disk-is-almost-full)

Canonical: https://siftmac.com/errors/no-space-left-on-device
