7

Listing local snapshots yields this

> tmutil listlocalsnapshots /
com.apple.TimeMachine.2018-01-30-194719
com.apple.TimeMachine.2018-01-30-211627
com.apple.TimeMachine.2018-01-30-224917
com.apple.TimeMachine.2018-01-30-234619
com.apple.TimeMachine.2018-01-31-014151
com.apple.TimeMachine.2018-01-31-024107
com.apple.TimeMachine.2018-01-31-034442
com.apple.TimeMachine.2018-01-31-044108
com.apple.TimeMachine.2018-01-31-054441
com.apple.TimeMachine.2018-01-31-064120

and i try to delete a local snapshot but running this

> sudo tmutil deletelocalsnapshots 2018-01-30-194719
Deleted local snapshot '2018-01-30-194719'

but listing the local snapshots again showed that the snapshot has not been removed

> tmutil listlocalsnapshots /
com.apple.TimeMachine.2018-01-30-194719
com.apple.TimeMachine.2018-01-30-211627
com.apple.TimeMachine.2018-01-30-224917
com.apple.TimeMachine.2018-01-30-234619
com.apple.TimeMachine.2018-01-31-014151
com.apple.TimeMachine.2018-01-31-024107
com.apple.TimeMachine.2018-01-31-034442
com.apple.TimeMachine.2018-01-31-044108
com.apple.TimeMachine.2018-01-31-054441
com.apple.TimeMachine.2018-01-31-064120

Just for fun i wrote a little bash script to delete them all (which also avoids any typos).

for date in $(tmutil listlocalsnapshots / | perl -pe 's/com.*(2018.*)/\1/'); do echo "deleting $date"; sudo tmutil deletelocalsnapshots "$date";  done

Strangely enough, i can repetitively run that command above and it will always show the same output:

deleting 2018-01-30-194719
Deleted local snapshot '2018-01-30-194719'
deleting 2018-01-30-211627
Deleted local snapshot '2018-01-30-211627'
deleting 2018-01-30-224917
Deleted local snapshot '2018-01-30-224917'
deleting 2018-01-30-234619
Deleted local snapshot '2018-01-30-234619'
deleting 2018-01-31-014151
Deleted local snapshot '2018-01-31-014151'
deleting 2018-01-31-024107
Deleted local snapshot '2018-01-31-024107'
deleting 2018-01-31-034442
Deleted local snapshot '2018-01-31-034442'
deleting 2018-01-31-044108
Deleted local snapshot '2018-01-31-044108'
deleting 2018-01-31-054441
Deleted local snapshot '2018-01-31-054441'
deleting 2018-01-31-064120
Deleted local snapshot '2018-01-31-064120'

Why are my snapshots not deleting? I am quite low on storage space (13gb of space - the snapshots would not even clear when i had 2gb of free space left)

  • It works for me... AFPS bug maybe? – Nibor Ndj Mar 24 '18 at 22:03
  • 1
    Yes, I think that the snapshot had become corrupted. Doing what i said in my answer fixed it. – Dylanthepiguy Mar 24 '18 at 22:14
  • 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 16:37
  • My snapshots don't have an am or p.m. suffix > tmutil listlocalsnapshots / com.apple.TimeMachine.2018-06-28-154948 – Dylanthepiguy Jun 28 '18 at 8:52
  • Darnit, mine do:( If I try to delete using just the date, it gives a 'not found' adding am/pm fails to parse [can't test exact wording right now, only have one snapshot & don't want to break things... even more ;) Your script gives 'error parsing argument'.. but that's because it's trying to find 'pm' not the date. $ tmutil listlocalsnapshots / com.apple.TimeMachine.2018-06-27-10346 pm – Tetsujin Jun 28 '18 at 17:40
4

I think the least-recent time machine snapshots was corrupted - potentially from some system crashes caused by APFS bugs.

I tried running DIsk Utility's first aid, but that froze my computer for over 3 hours (maybe it ran out of space to work with?) - I ended up having to force-restart.

I solved the problem by running first aid booted from an external hard drive install of High Sierra. It removed some old snapshots. I then was able to boot from my normal drive and run tmutil deletelocalsnapshots... which successfully deleted the snapshots and freed up space

  • Wouldn't it be good if you could just do this from Recovery... but tmutil doesn't exist in Recovery :/ – Tetsujin Jul 26 '18 at 12:00
  • Just adding that if your interrupt (CTRL+C) tmutil deletelocalsnapshots __SOME_DATE__, tmutil listlocalsnapshots / will tell you it is still here. And you won't be able delete it (still saying it is here). So just reboot your Mac then tmutil deletelocalsnapshots __SOME_DATE__ will work. – MacKentoch Mar 18 at 8:05
1

Great solution detecting that the filesystem was corrupt when the normal commands were note working. Also note, you can avoid iterating on the list of snapshots and just direct the system to reclaim space up to and surpassing the limit you choose:

tmutil thinlocalsnapshots / $(echo "5 * 1000000000" | bc) 2

The above command asks for 5 GB of cleaning. I chose the math to make it easy to dial up and down without the long scoring of zeroes getting changed. Feel free to simplify the above command with a number you like that’s larger than your drive if you insist the system clean all possible snapshots.

How to thin your local Time Machine Snapshots on macOS High Sierra

You must log in to answer this question.

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