My MacBook Pro M1 has been reporting wrong disk usage in the Disk Usage part of System Settings. The bar showing total usage and free space would report about 120GB in use, where in reality the Documents would already be higher than that. Add up the Apps and other things and it’s obvious the disk usage reported doesn’t add up. On peculiar thing is that calculating system data would never finish. Going to the terminal and doing a df -h
would also report weird usage: over 600GB of space in use, where I expected it to be around 320GB. So, what’s going on?
Digging through the file system I noticed that /Library/InstallerSandboxes/.PKInstallSandboxManager
was taking up over 200GB! Stuff in this folder is hidden by default and using the terminal you’ll need to use sudo
to actually view what’s inside there. In my case it was all Xcode related. To my understanding macOS temporarily stores installers/updates in this folder. When done the files should be cleaned up automatically. I remember when I got my MacBook Pro (which came with Big Sur) had issues updating Xcode. It could take all day to finish! This problem persisted with Monterey but I think starting with Ventura I no longer had any issues anymore. The contents in this folder turned out to be stale update files between 1-2 years old. Deleting them would do the trick…
That is, if you can actually delete the files! A quick online search showed other people having similar issues and simply deleting the contents of .PKInstallSandboxManager
would reclaim the lost space. On my M1 Mac however all I got was a Permission denied message and that included deleting with sudo
…
Luckily, there’s a fix for this though it’s a bit cumbersome. It requires you to temporarily disable System Integrity Protection (or SIP). After that you can delete the stale updates and reclaim your space. Having done that the Disk Usage utility inside System Settings will recalculate and give you the actual disk usage of your system – even system data usage will be reported again!
Steps for deleting stale updates in InstallerSandboxes
- Boot your Mac into recovery mode.
- Launch a terminal from the Utilities menu and run
csrutil disable
. - Reboot your Mac. Preferably in Safe Mode.
- Launch a terminal and run
sudo rm -rf /Library/InstallerSandboxes/.PKInstallSandboxManager
- Shutdown your Mac and boot into recovery mode again.
- Again launch a terminal and run
crsutil enable
. - Regularly boot into macOS, launch System Settings and go to Disk Usage. Let it recalculate usage.
But df
is still reporting wrong usage!
Yes, I noticed this as well. TimeMachine also stores a local backup even if you’ve set it up to do backups to an external or remote device. Adding the usage of that backup to the reported usage of the Disk Usage utility in System Settings again came close to my actual usage. After a day or so df
would actually report the TimeMachine backup as a separate volume (again) which made the data volume be correct again.