2

The 'df' has been my tool of choice to investigate how much free space I have on my disk. But with APFS, TimeMachine local snapshots and all that, it has become unreliable.

I.e. after removing a lot of files and folders, thus freeing up 100GB, it is of course not yet freed up as it is still part of TimeMachine's local snapshots (I really wish Apple would return to us the possibility to turn local snapshots off, it plays havoc with your control over storage use and it comes with risks). Commands like tmutil deletelocalsnapshots 2019-11-23-180038 seem not to delete anything, as the local snapshot keeps being listed.

Only Storage of System Information now says there is 100GB extra free space. df still reports the space is not free, so Storage of System Information apparently has access to underlying info that makes it report 'virtual free space'.

Deleting local snapshots doesn't do a thing, it seems:

bash-3.2# tmutil listlocalsnapshotdates
Snapshot dates for all disks:
2019-11-23-180038
2019-11-23-192007
2019-11-23-210050
2019-11-23-220637
2019-11-24-100307
2019-11-24-110637
2019-11-24-122648
2019-11-24-165006
bash-3.2# tmutil deletelocalsnapshots 2019-11-23-180038
Deleted local snapshot '2019-11-23-180038'
bash-3.2# tmutil listlocalsnapshotdates
Snapshot dates for all disks:
2019-11-23-180038
2019-11-23-192007
2019-11-23-210050
2019-11-23-220637
2019-11-24-100307
2019-11-24-110637
2019-11-24-122648
2019-11-24-165006

To be honest, I just want to be able to simply free up space and really have it freed up, not linger around in local snapshots. Is that at all possible? Why does Apple makes this simple task so incredibly hard?

  • I suspect you have a corrupt wrapper container - see apple.stackexchange.com/questions/314038/… in my answer. You’re deleting and thinning and space should be free. I might have to reorder my answer if you don’t solve this and post a superior answer to mine – bmike Nov 24 '19 at 17:28
  • That one is about High Sierra (which has many more bugs in APFS). I'm on Mojave. I was able to solve this using tmutil thinning, followed by tmutil deletion. After thinning with tmutil thinlocalsnapshots / 9999999999 1, df reported 30GB more free, after then deleting the last snapshot (which could be deleted successfully after thinning) it reported 70GB more free. System Information used to report 100GB more free than df, this is now back to 20GB. – gctwnl Nov 26 '19 at 11:27
2

The new command to purge snapshots is seriously faster and more well engineered than the previous local store.

It does require a new syntax, so you’re correct, Apple has forced us to learn more and change.

Joshua was in your situation as well and has a very detailed explanation:

Apple tools take a while to classify what’s purgeable, but that is getting better.

If you don’t see immediate clearing of space, it’s a sign your disk has accounting issues and you need to boot to internet recovery or plain recovery on an external drive and repair the wrapper and container.

  • The answer above is mostly correct (so I upped it) even if it is mostly based on information based on High Sierra. The last part about 'not deleting snapshots' being a sign of corruption, I do not know. Using a combination of 'thinning' and then 'deleting', I was able to remove all snapshots and recover free space. Because of that, I am going to write my own answer as well. – gctwnl Nov 26 '19 at 11:32
  • This answer works for Catalina and below despite some of the links / tools arriving on scene in time for High Sierra’s release. – bmike Nov 26 '19 at 12:14
0

The other answer was mostly correct (see my comment), but I'm going to give my own simple answer here, for one because my answer comes from Mojave, not High Sierra, experience.

While I was unable to delete local snapshots by using the specific tmutil 'delete' command, they were mostly deleted by the tmutil 'thinning command.

I started with df reporting 63GB free and System Information reporting 160GB free. A 100GB difference.

I executed tmutil thinlocalsnapshots / 9999999999 1. That removed all but one of my local snapshots and made df report 30GB more free. It might be necessary in some circumstances to thin more.

Then I was able to remove the last local snapshot with tmutil deletelocalsnapshots and after that df reported 167GB free, while System Information reported 186GB free, a 19GB difference. That is within tolerable differences for me.

In other words, what seems not to be the case so far is that the unability to remove localsnapshots means you have a corruption. After thinning, the localsnapshot could be removed. Of course, that still can mean there is a corruption and that thinning is more robust than deleting.

  • Nice answer. - you are seeing the immediate clearing I mentioned at each step, so no signs of corruption. You would see the corruption from fsck failures in the log of Disk Utility. Glad you have a process that works for you. – bmike Nov 26 '19 at 12:13

You must log in to answer this question.

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