How to get the Trash working properly

One of the most common questions I get asked is why emptying the Trash doesn’t work as expected. I’m sure you’ve done it yourself: you’re running a bit short of space on your main Data volume, perhaps when preparing to install a macOS update. To free up tens of GB you put some large files in the Trash, but when you empty it, free space on that volume stays unchanged. Why?

My first question is the same every time: are you backing that volume up using Time Machine, or other software that makes snapshots? If so, you’ll need to wait 24 hours before that space gets freed up, and reflected in the space available on that volume, because snapshots.

What happened

Whenever Time Machine makes a backup, it starts by making a snapshot of each volume it’s going to back up. It uses that to create the backup on the volume storing its backups, and for 24 hours keeps those hourly snapshots on the volume(s) being backed up as well (although technically in the same container rather than inside the volume). This is a feature of Time Machine, and can’t be disabled, nor can you change the period for which its snapshots are retained. Other backup software may do the same thing, but should give you full control over those snapshots; Time Machine has no way of changing its behaviour.

If the large files you put in the Trash were on the volume being backed up when Time Machine made one of those hourly snapshots, then the data for those files will be retained as part of that snapshot, until the last snapshot containing those files is deleted. Only then can the data for those files be removed, and the space they took up will be freed. That’s the way that snapshots work, so you can roll back to those files using that snapshot.

Snapshots are made of whole volumes, not just the parts you might want to back up. Time Machine lets you exclude volumes and folders, and might only be backing up a single folder on that volume. But, unless the whole volume is excluded from its backups, it will make a fresh snapshot of every volume it’s backing up every hour, and that will result in all the data from trashed files being retained and not freed for reuse until that snapshot is automatically removed, 24 hours later.

Make a BigFiles volume

The cleanest way to avoid this happening is to keep all downloads and large temporary files on a separate volume which isn’t backed up, so doesn’t have snapshots made of it automatically.

In Disk Utility, select the APFS container containing that Data volume, and in the Volume tool at the top of the window click the + tool. Give the new volume a suitable name like BigFiles, leave its format as plain APFS, and click on the Add button.

To make this simpler to use, add a Downloads folder to your new volume, then set apps like Safari that you use to download large files to save them in that folder on your BigFiles volume. For Safari, that means opening its Settings, and in the General view change the File download location to your new folder on BigFiles.

For your own confidence, open Time Machine settings, click on its Options… button and check that BigFiles is listed there as a volume that isn’t to be backed up. Then check using an unwanted file that trashing a file from BigFiles does immediately return its size as free space, to confirm that your Trash now does what you expect it to.

This is also a good solution for the storage of virtual machines (VMs) and other very large files that you don’t want Time Machine to back up, as it also ensures that they aren’t included in snapshots.

Timing

If you don’t want to use a BigFiles volume, or can’t select where to save a large temporary file, you can work around snapshots by timing. Before acquiring that large file, check when the last Time Machine backup was made, using the Time Machine item in the menu bar. Provided there’s sufficient time before the next backup is due, you can download the large file(s), move them to another disk for storage or otherwise use them, then put them in the Trash. But the most essential step is that you must then empty the Trash before the next backup starts, or they’ll be captured in the next automatic snapshot.

Deleting snapshots

If large files do get captured in a snapshot and you still need the free space, the only answer is to delete all the snapshots referring to them, normally the latest. You can do that in Disk Utility using the Show Snapshots command in its View menu. Select the correct volume, identify the snapshot(s) in the list, select them, and click on the – tool below. Alternatively, Carbon Copy Cloner provides better controls over snapshots.

Caches and temporary files

While Time Machine backups themselves exclude some transient files, snapshots can’t, and inevitably capture many cache and similar files. One important exclusion is swap storage used to support virtual memory, as that’s confined to the VM volume. Perhaps it’s time for macOS to move other cache and transient file storage from the main Data volume to a separate volume such as BigFiles, so reducing overhead in both Time Machine backups and in snapshots.

Summary

  • Volumes backed up by Time Machine have snapshots made of them every hour, and those snapshots are retained for 24 hours.
  • Trashing files on such volumes won’t immediately release the space they occupy until the last snapshot referring to them is deleted, typically 24 hours after they’re emptied in the Trash.
  • This affects all volumes that are backed up by Time Machine, even when only a small part of that volume is backed up, as snapshots contain the whole volume.
  • To avoid large transient files being included in snapshots, store them on a separate volume that isn’t backed up. Emptying the Trash then recovers the space they occupied immediately.