Delete macOS Local Time Machine Snapshots

How to save some disk space by removing macOS local snapshots

Recently, I’ve been running out of SSD space on my 13" MacBook Pro. I tried to scan for the entire disk using Disk Inventory X and found nothing substantial. Until I finally read an article explaining the cause of suddenly losing disk space.

Did you know that since macOS High Sierra and later, a Time Machine local snapshot is created and saved before installing any macOS update?

I honestly didn’t know until I read the knowledge base article from Apple website.

This snapshot was created automatically by macOS, but there is no guide on how to delete it. I know that this snapshot might be important during the update in case there is a problem during the process. But since I successfully updated my macOS, I don’t think I really need it to stay. Especially if you have limited disk space.

Luckily there is a solution to reclaim disk space by using simple terminal commands.

Solution

To follow this guide, you need to open Terminal.app or any terminal emulator like iTerm.

The first thing to do is to get a list of saved local snapshots. You can do that by typing the following command.

tmutil listlocalsnapshots /

It’ll produce a list of snapshot with this format name:

com.apple.TimeMachine.yyyy-MM-dd-hhmmss

To delete the snapshot file, all you need to do is to copy the timestamp with yyyy-MM-dd-hhmmss format. Then use it with the following command.

sudo tmutil deletelocalsnapshots yyyy-MM-dd-hhmmss

You’ll be asked for your password. Type your password and press Enter. Wait for a couple of seconds until the process is finished.

Example

Today, I got notification from Apple that macOS Mojave 10.14.6 Supplemental Update 2 is available to install. Naturally, I install the update to make it more secure.

First, let’s see the free disk space after the update and before local snapshot removal. I use df command line to see the information.

$ df -h
Filesystem      Size   Used  Avail Capacity iused               ifree %iused  Mounted on
/dev/disk1s1   234Gi  157Gi   75Gi    68% 1951850 9223372036852823957    0%   /

As you can see, It’s only available around 75GB of disk space.

Let’s continue by listing available local snapshots.

When I type the command to list all local snapshots, I only received one snapshot with timestamp 2019-09-27-062451.

$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2019-09-27-062451

Next, I copy the timestamp 2019-09-27-062451 and use it for deletion command.

$ sudo tmutil deletelocalsnapshots 2019-09-27-062451
Deleted local snapshot '2019-09-27-062451'

I was asked for my password then the process was running for less than a minute.

Finally, let’s see again how much disk space is available after the snapshot deleted.

$ df -h
Filesystem      Size   Used  Avail Capacity iused               ifree %iused  Mounted on
/dev/disk1s1   234Gi  150Gi   82Gi    65% 1951859 9223372036852823948    0%   /

As you can see, now it’s 82 GB free disk space. It was only 75 GB of free disk space. Which mean I just free around 7GB of disk space!


So that’s all I can write for this time. Hope this simple guide useful for you. Thanks for reading.

References

Cover Photo by Carl Heyerdahl on Unsplash