As part of a recent clean-up of my Apple File System-formatted (APFS) boot drive, I deleted a number of files. However, I noticed that deleting files did not free up nearly as much space as I thought it should. When I investigated, I noticed that my boot drive had a number of Time Machine snapshots stored on it.
A quick way to reclaim space from a particular snapshot immediately would be to delete the snapshot using the tmutil command line tool, using the command shown below:
tmutil deletelocalsnapshots snapshot-name-here
However, I didn’t want to delete backups if I could avoid it since I might need something stored in one of them. After some research, I was able to find a tmutil command that did what I needed. For more details, please see below the jump:
The tmutil command line tool on macOS High Sierra includes a thinlocalsnapshots function, which has the options shown below:
tmutil thinlocalsnapshots mount_point [purge_amount] [urgency]
Purge amounts are represented as bytes, so specifying 20 gigabytes of space would be represented by the number below:
21474836480
Urgency levels are 1 through 4, with the default urgency setting being 1.
Urgency level 4
Most urgent: Any current backup processes are stopped and thinning is performed immediately. The largest available backup will be the first thinned, with thinning proceeding through the next largest backups.
Urgency level 1
Least urgent: Current backup processes will be completed before the thinning process begins. The oldest available backup will be thinned first, with thinning proceeding through the next oldest backups.
To free up 20 gigabytes of space from the snapshots stored on the boot drive at maximum urgency, you would use the command shown below:
tmutil thinlocalsnapshots / 21474836480 4
The command may take a while to run, depending on what would need to be done to free up the requested space.
Note: The thinning process may actually free up more than the requested space, but it should free up the requested space as a minimum if the stored snapshots are taking up at least that amount of drive space.
Before snapshot thinning
Snapshot thinning
After snapshot thinning