47

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?

2
  • Usually setting up a partition before you set up Time Machine helps. Dec 15, 2017 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. Dec 16, 2017 at 2:31

2 Answers 2

61

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, but @Clete2 and @orkoden think 4 is 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 "meh, whenever" and urgency set to 4 means "very urgent".

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:

  1. I was wondering how I was losing all my free disk space so suddenly, and;

  2. 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

9
  • 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, 2018 at 12:07
  • 4
    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, 2019 at 18:58
  • 1
    When I used 1 for urgency, it did nothing. I tried 4 and it purged everything (with the 100GB option). I think 4 is high?
    – Clete2
    Feb 11, 2021 at 1:58
  • 1
    For me 4 seemed to be high priority as well. With 2 nothing happened, but with 4 the computer was under heavy load for a few minutes and there was considerable thinning.
    – orkoden
    Dec 6, 2022 at 18:23
  • 1
    @orkoden Thanks for corroborating. I've updated the answer to reflect this assumption now. Dec 7, 2022 at 16:55
3

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.

4
  • 5
    "At least this is what Apple claims." There's the gotcha. Feb 11, 2018 at 17:35
  • 5
    Almost always, if I run out or low on space, when I need the space is NOW not in 24 hours! Dec 13, 2018 at 16:45
  • 2
    tmutil listlocalsnapshotdates / reports a snapshot from 02-01-2019. "At least this is what Apple claims." Feb 11, 2019 at 14:20
  • 3
    I can confirm, through a good time period, that even when connected to the Time Machine drive continuously, the local snapshots didn't get cleared out. IME, it could be an alarming case of the incredible shrinking available space.
    – karolus
    Sep 26, 2020 at 18:27

You must log in to answer this question.

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