21

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?

  • Usually setting up a partition before you set up Time Machine helps. – Melvin Jefferson Dec 15 '17 at 22:01
  • 1
    @MelvinJefferson I would definitely agree with that. But that requires foresight. ;) I ended up turning off Time Machine while creating the partition and setting up Boot Camp anyway. That helped keep the disk system stable during partition and install. – Joshua Pinter Dec 16 '17 at 2:31
29

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 call man tmutil to get more details, specifically on thinlocalsnapshots:

thinlocalsnapshots mount_point [purge_amount] [urgency]
             Thin local Time Machine snapshots for the specified volume.

             When purge_amount and urgency are specified, tmutil will attempt (with urgency level 1-4) to reclaim purge_amount in bytes by thinning snapshots.

             If urgency is not specified, the default urgency will be used.

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:

$ 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 running without the purge_amount and urgency options, it's likely that no local snapshots will be purged:

$ tmutil thinlocalsnapshots /
Thinned local snapshots:

With purge_amount set to 1000000000 (1 Gigabyte):

$ tmutil thinlocalsnapshots / 1000000000
Thinned local snapshots:
2017-12-14-173102

And if I run that again:

$ tmutil thinlocalsnapshots / 1000000000
Thinned local snapshots:
2017-12-14-212356

Here's what's happened to my local snapshots list:

$ tmutil listlocalsnapshots /
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

Let's try running that same command one more time:

$ tmutil thinlocalsnapshots / 1000000000
Thinned local snapshots:
2017-12-15-052254
2017-12-15-084940

$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2017-12-15-094508
com.apple.TimeMachine.2017-12-15-121635

And again:

$ tmutil thinlocalsnapshots / 1000000000
Thinned local snapshots:
2017-12-15-094508

$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2017-12-15-121635

And once more to try and remove that final local snapshot:

$ tmutil thinlocalsnapshots / 1000000000
Thinned local snapshots:

$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2017-12-15-121635

You can see it didn't do anything this time.

Let's try increasing the bytes to 10 GBs:

$ tmutil thinlocalsnapshots / 10000000000
Thinned local snapshots:

Still nothing. Let's try 100 GBs:

$ tmutil thinlocalsnapshots / 100000000000
Thinned local snapshots:

Again, nothing.

So, when it gets to the last local snapshot, it must have to do with the urgency option rather than the purge_amount.

Let's go back to just 1 GB for the purge_amount but try with urgency set to 1 (another omission in the manual is whether 1 is high or 4 or high):

$ tmutil thinlocalsnapshots / 1000000000 1
Thinned local snapshots:
2017-12-15-121635

$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2017-12-15-121635 (dataless)

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" and urgency 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

A) I was wondering how I was losing all my free disk space so suddenly, and;

B) 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

  • I've been trying to get various snapshot functions to work recently. Have you noticed, or is it just me... that snapshots have an am or pm suffix now, which seems to break the delete function? – Tetsujin Jun 27 '18 at 12:07
  • No idea. Not sure what you mean by "delete function" either. – Joshua Pinter Jun 27 '18 at 15:50
  • Sorry, too many snapshot questions open at once ;) I meant to put this under apple.stackexchange.com/q/314038/85275 – Tetsujin Jun 27 '18 at 16:37
  • 2
    Great post! Couldn’t find anything else on the internet that actually let me reclaim space. I really like how you experimented to figure out what the options mean, then documented it. – andrew Jan 3 at 18:58
  • @andrew Thanks, Andrew! I didn't find anything else out there either so I thought I'd step through it and bring you along for the ride. :) – Joshua Pinter Jan 3 at 19:11
2

Local snapshots are for using time machine when not connected to your time machine drive. They only last for 24 hours. So you should not have to clear them out. At least this is what Apple claims. Free space doesn't seem to be consistently reported within the OS. In some places it shows the snapshots as taking up real space, other places it is shown as purgeable. The applications think it is taking up real space and it can cause problems.

  • 3
    "At least this is what Apple claims." There's the gotcha. – Joshua Pinter Feb 11 '18 at 17:35
  • 3
    Almost always, if I run out or low on space, when I need the space is NOW not in 24 hours! – Victor Engel Dec 13 '18 at 16:45
  • 1
    tmutil listlocalsnapshotdates / reports a snapshot from 02-01-2019. "At least this is what Apple claims." – Julian F. Weinert Feb 11 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .