"No space left on device" on Mac: how to fix it
"No space left on device" (errno 28, ENOSPC) means a program tried to write to your Mac's startup disk and found no usable free space. Start by checking what is using storage, emptying the Trash and removing large files. If the disk still looks full, local Time Machine snapshots are the next thing to check.
On this page
What it means
The message comes from the operating system itself. A program asked to write data, the startup volume had no usable free blocks, and macOS answered with error 28, "No space left on device". You can see it in Terminal, but also in git, npm, pip, Xcode, Docker and app installers.\n\nIt is confusing when Finder or System Settings still shows some free space. On APFS, "available" space includes purgeable space such as local snapshots and caches. The interface counts it as free, but it is not always released at the moment a program needs it. So the figure in Finder or Settings can be higher than what a program can actually write to. To see the number the system itself reports, use df -h / in Terminal (see the verify section).
Symptoms and causes
You are likely dealing with this problem if:
- Terminal, a build tool or an installer prints "No space left on device".
- A macOS update or an app installation fails because of lack of space.
- "Your disk is almost full" warnings appear.
- System Data (or "Other") looks very large in Storage settings.
- Free space in Finder does not match what Terminal reports.
The usual causes, most common first:
- The disk is really full of your own data
- Large files, Downloads, photo and video libraries, old iPhone and iPad backups, unused apps and a Trash that has not been emptied are the usual culprits.
- System Data growth
- Caches, logs and temporary files add up in the System Data category. Apple describes the category but does not give a way to shrink it directly.
- Time Machine local snapshots and purgeable space
- Snapshots on the APFS volume can make the disk look full. A 2026 test by Eclectic Light Company on macOS Tahoe 26.6.2 found Time Machine's CacheDelete reporting 0 bytes purgeable while about 94.9 GB was purgeable. This comes from one author's test, so other versions are not confirmed.
How to fix it
Work through these in order. They start with the quickest, safest checks and move to deeper repairs; stop as soon as the problem is gone.
1.See what is using the space
Knowing which category is large tells you where to look first.
- On macOS Ventura 13 or later, open the Apple menu, then System Settings > General > Storage.
- Click More Info (the info button) beside a category to see its items.
- On earlier macOS versions, open the Apple menu > About This Mac > Storage instead.
2.Empty the Trash
Files in the Trash still occupy space until the Trash is emptied.
- Check the Trash for anything you still want, and move it out.
- Empty the Trash from the Finder.
3.Remove or move large and replaceable items
Apple lists these as the main ways to free space, and they usually recover the most.
- Move photo and video libraries to an external drive.
- Delete media you can download or stream again, and clear the Downloads folder.
- In Mail, use the Erase Junk Mail and Erase Deleted Items commands.
- Delete old iPhone and iPad backups you no longer need.
- Uninstall apps you do not use.
- Remove user accounts that are no longer needed and check the Users folder for leftover data.
- Compress files you rarely open.
- Empty the Trash again afterward.
4.Let the Mac use iCloud to make room
Apple says the Mac can use iCloud to make storage available automatically when needed.
Before you start: Files kept in iCloud count against your iCloud storage plan, so check your plan has room before enabling this.
- Open System Settings > General > Storage and review the recommendations shown there, including the iCloud options.
5.Clear user cache contents
User caches can grow large, and apps rebuild them as needed.
Before you start: Delete only the contents of cache folders, never the folders themselves, and never system folders. Check what a folder holds before deleting. This method is described by a vendor blog (MacPaw), not by Apple.
- In the Finder press ShiftCommandG and enter the path below.
~/Library/Caches/ - Open the cache folders and delete the files inside them, leaving the folders in place.
- Empty the Trash and restart the Mac.
6.Delete local Time Machine snapshots in Disk Utility
If the disk looks fine in Finder but writes still fail, snapshots may be holding space that the system does not release when asked. Eclectic Light Company recommends deleting snapshots manually in Disk Utility rather than waiting for automatic purging.
Before you start: Deleted snapshots cannot be recovered. Make sure your Time Machine backup on the external drive is current first, and only delete snapshots you recognise as old.
- Open Disk Utility (in Applications > Utilities) and select the startup volume in the sidebar.
- Choose View > Show APFS Snapshots to list the snapshots on that volume.
- If you use Time Machine, look for snapshots older than 24 hours. Eclectic Light says these can be orphaned, meaning they stayed behind instead of being purged.
- Select an old snapshot you do not need and delete it with the remove (minus) button, then restart the Mac and check the free space again.
Check that it worked
- The command that failed before now completes without "No space left on device".
- In Terminal, run
df -h /and check the Avail column. This is the free space the system itself reports, so it is the figure that matters for this error. - Storage in System Settings > General shows a healthy amount of free space. Keep in mind that Finder and Settings include purgeable space in their free figure, so they can look better than
df -h /.
If it still fails
- Go back to the Storage view and look at which category is still largest, then work on that one.
- Restart the Mac and run
df -h /again, since purgeable space may take time to be released. - Avoid tricks such as filling the disk with a huge file and deleting it. They can destabilise the system.
- Contact Apple Support or visit an Apple Store if the Mac still reports a full disk after cleanup.
Questions
Why does Finder show free space but I still get the error?
Purgeable space (snapshots and caches) is counted as available but is not always released when a program writes. Deleting old local snapshots, or freeing real space, usually fixes it.
How much free space should I keep?
Apple's page gives no minimum, so there is no official figure to quote. Keep a comfortable margin and check with df -h / if errors return.
Sources
- Free up storage space on MacOfficial · Apple Support
- Why can purging snapshots fail? · Eclectic Light Company
- 5 fixes for "No space left on device" error on Mac · CleanMyMac (MacPaw)