Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kirbyrun

macrumors 6502
Original poster
Hi! This is a long story, but I'll do my best to keep it short...

Since updating to 26.5, my M4 Mini has been locking up several times a minute. corespotlighd seemed to be the culprit, taking anywhere from 100-300% CPU.

Tried all the usual troubleshooting, killed corespotlightd in Activity Monitor and Terminal... Nothing.

Got escalated to a senior advisor at Apple. We discovered that even though Finder was reporting over 100GB free on my 1TB SSD, Disk Utility showed only 13GB free! The rest was "purgeable," but nothing we did could get the system to let go of that space. I couldn't even reinstall from Recovery because the system insisted I only had 13GB free.

I deleted a TON of stuff in desperation, but it all just went to "purgeable" and was unavailable to me. Finally, after an hour or so of waiting, the system math caught up and I had that space "for real..." and the problem went away. Seems like it was some kind of glitch where the system thought I had less free space than I did and thus everything was slowing down and corespotlightd was killing my I/O trying to write files to disk. But now that I'd cleared another 100GB or so, everything was working fine.

Great, right?

Except now, 36 hours later, it's happening again. Back to multiple freezes, beachballs, etc. corespotlightd killing my CPU. And while Finder says I have over 200GB of free space, Disk Utility says most of it is "purgeable" and only credits me with a dozen or so GB.

Meaning I'm back where I started with a useless Mini and no way to reinstall!

Anyone have any ideas that could help? I've tried deleting Time Machine snapshots. I've tried excluding my drive from Spotlight, then including it. I'm not looking forward to more hours on the phone with Apple!
 
Hi,

Do you use Time Machine?

As far as I know every hour time machine will purge these areas automatically after a backup.
 
Another "Fishrrman dumb question":
Did you try a full shutdown, followed by a restart?

More dumb thoughts:
If Spotlight seems to be messing with things, have you considered TURNING OFF Spotlight, totally? It can be done...

(I banned Spotlight from my Macs from the time it was first introduced, a good number of years ago...)
 
Another "Fishrrman dumb question":
Did you try a full shutdown, followed by a restart?

More dumb thoughts:
If Spotlight seems to be messing with things, have you considered TURNING OFF Spotlight, totally? It can be done...

(I banned Spotlight from my Macs from the time it was first introduced, a good number of years ago...)
Yep, multiple reboots and shutdowns and restarts!

I think Spotlight is a symptom, not the cause. (I could be wrong, but Apple agrees with me.) It seems like corespotlighd is mucking things up because of the lack of drive space. And we can't figure out why the drive space is getting gobbled up like Pac-Man dots.
 
Do you use Google Drive or something similar? What about deleting the contents of your username/Library/Caches? Is there anything that needs so much space?
 
Do you use Google Drive or something similar? What about deleting the contents of your username/Library/Caches? Is there anything that needs so much space?
I use Dropbox and Box, but not Google Drive. Nothing huge in either of those. I don't see anything bigger than a couple of gigs in ~/Library/Caches.

I just copied my Photos Library to an external drive and deleted it from my SSD. Disk Utility helpfully notes that I have over 480GB free...450 of which is purgeable. Leaving me with 30ish GB free. Still not enough to reinstall. 🤦‍♂️
 
I use a shell script to manually delete Time Machine snapshots.

If you're familiar with Terminal, create a file (named, for example, "purge.sh") in your home directory and paste in it the following:

#!/bin/bash
for x in $(tmutil listlocalsnapshots /)
do
sudo tmutil deletelocalsnapshots $(cut -d '.' -f 4 <<<"$x")
done

Execute the script in Terminal with:

sh purge.sh

The password will be asked.
 
I use Dropbox and Box, but not Google Drive. Nothing huge in either of those. I don't see anything bigger than a couple of gigs in ~/Library/Caches.

I just copied my Photos Library to an external drive and deleted it from my SSD. Disk Utility helpfully notes that I have over 480GB free...450 of which is purgeable. Leaving me with 30ish GB free. Still not enough to reinstall. 🤦‍♂️
Well, I have read that most of apps like Google Drive will use a lot of space. What about the Application Support folder? And Containers?

I also suggest this:

 
Marco wrote:
"I use a shell script to manually delete Time Machine snapshots."

Heh.
The better way is to not use time machine at all.

I've never used it, not once, ever.
I use either SuperDuper or CarbonCopyCloner instead.

No snapshots to bother with...
 
Well, I have read that most of apps like Google Drive will use a lot of space. What about the Application Support folder? And Containers?

I also suggest this:

Forgot to mention: Apple had be restart in Safe Mode and also log into a different account. Same problem in both circumstances.

Nothing sizable in Application Support or Containers.
 
I use a shell script to manually delete Time Machine snapshots.

If you're familiar with Terminal, create a file (named, for example, "purge.sh") in your home directory and paste in it the following:

#!/bin/bash
for x in $(tmutil listlocalsnapshots /)
do
sudo tmutil deletelocalsnapshots $(cut -d '.' -f 4 <<<"$x")
done

Execute the script in Terminal with:

sh purge.sh

The password will be asked.
I tried this and only got:

Snapshots is not a valid disk
POSIXError(_nsError: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument")
for is not a valid disk
POSIXError(_nsError: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument")
disk is not a valid disk
POSIXError(_nsError: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument")
/: is not a valid disk
POSIXError(_nsError: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument")
 
Hm, does the following command in Terminal at least lists the snapshots (assuming they exist)?

tmutil listlocalsnapshots /
Yes, it does. But I just manually deleted a bunch of them in Disk Utility, so it only shows one now.

ETA: And holy crap -- that one is taking up almost half my SSD! We've found our problem... Gonna delete it and cross my fingers that I'll get enough space back to reinstall...
 
  • Like
Reactions: QuarterSwede
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.