I have noticed that my extra space just suddenly disappears since upgrading to macOS High Sierra. For example, I have 170 GBs free in the morning and then by the afternoon I'm down to 56 GBs.
Then sometimes that shoots back up to 170 GBs. It's a little odd and rebooting sometimes works but sometimes doesn't.
I started looking into "local snapshots" that are created by Time Machine automatically. I assume these are locally stored snapshots that are created for efficiency of Time Machine. Maybe when it's not connected to the Time Machine disk so that it can still have a versioned backup. Not sure.
You can view your local snapshots like so:
$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2017-12-14-173102
com.apple.TimeMachine.2017-12-14-212356
com.apple.TimeMachine.2017-12-15-052254
com.apple.TimeMachine.2017-12-15-084940
com.apple.TimeMachine.2017-12-15-094508
com.apple.TimeMachine.2017-12-15-121635
When I run tmutil
in my Terminal I see a command called thinlocalsnapshots
. What does that do and how do I use it?
Best Answer
Spoiler: I went from ~50 GBs free to ~277 GBs free, about 227 GBs difference, over the course of this answer.
There's not a tonne of information from the basic
tmutil
function but you can callman tmutil
to get more details, specifically onthinlocalsnapshots
:A noticeable omission is what the
default urgency
actually is and whether 1 is high urgency or 4 is high urgency.To show you what's happening in real-world usage, here is my starting list of local snapshots:
When running without the
purge_amount
andurgency
options, it's likely that no local snapshots will be purged:With
purge_amount
set to1000000000
(1 Gigabyte):And if I run that again:
Here's what's happened to my local snapshots list:
Let's try running that same command one more time:
And again:
And once more to try and remove that final local snapshot:
You can see it didn't do anything this time.
Let's try increasing the bytes to 10 GBs:
Still nothing. Let's try 100 GBs:
Again, nothing.
So, when it gets to the last local snapshot, it must have to do with the
urgency
option rather than thepurge_amount
.Let's go back to just 1 GB for the
purge_amount
but try withurgency
set to1
(another omission in the manual is whether1
is high or4
or high, but @Clete2 thinks4
is high):Success!
You can see that it thinned the last remaining local snapshot and now when you
listlocalsnapshots
you'll see only the latest one but it is tagged as(dataless)
.I'm willing to bet that
urgency
being set to 1 means "very urgent" andurgency
set to 4 means "meh, whenever".Over the course of these trials my hard drive has gone from ~50 GBs free to ~277 GBs free. A freeing up of about 227 GBs!
I would assume that these local snapshots would get thinned automatically, especially when additional space is required so you shouldn't have to worry about this too much.
But, I ran into this because
I was wondering how I was losing all my free disk space so suddenly, and;
I was trying to make a Boot Camp partition to run Windows and I didn't have enough space, even tho most of that space was just being taken up by local snapshots.
Going forward, I'm wondering if I should have a cron job run a thinning command every week or so, just to keep things clean. I'll see what happens after a few more days and add anything back here that I find.
Here is the Apple site for more information about how Time Machine's Local Snapshots are used:
https://support.apple.com/en-ca/HT204015