Follow These Steps to Clear Space on Your Mac

Thanks for all the great suggestions.
One file I’d like to remove( don’t have an Airport router ) but clearly requires extra effort is AirPort Uility.app. All the obvious efforts ( such as booting into the restore partition, turning off SIP and using Terminal.app commands ) fail ( M2 Mini Pro and Ventura here ). Haven’t tried writing code but I suspect a Foundation call will have similar permissions issue as an ‘rm’ in Terminal.app. If anyone knows a way to delete this puppy, please shout. TIA.

The only other trick I use is afsctool, a command line app to apply transparent compression to files. Transparent compression is the same concept as DiskDoubler, mentioned fondly in the article.

I’ve automated it to compress all apps added to /Applications within the past week. The apps remain executable and are as quick or quicker to launch. So like the old AutoDoubler app.

The technology used is Apple’s own filesystem compression, exactly the same thing that is used to compress apps downloaded from the Mac App Store. If Apple use it, why shouldn’t we?

eg. Calibre ebook library app is 700MB but compresses to 350MB! Get Info will show 700MB file size, but actual disk space used is only 350MB.

Huge savings on big apps like Microsoft Office, etc.

https://github.com/RJVB/afsctool and it’s also installable using brew.

Ref: https://en.wikipedia.org/wiki/DiskDoubler

apps from Mac App Store:
Screen shot 2024-04-04 at 16.16.09 Screen shot 2024-04-04 at 16.16.31

apps run through afsctool:
Screen shot 2024-04-04 at 16.16.03 Screen shot 2024-04-04 at 16.16.25

Screen shot 2024-04-04 at 18.12.01 Screen shot 2024-04-04 at 18.12.02

That does seem out of control. Did you check the path suggested in the article to see if it’s related to attachments being downloaded? There may also be some logs that are seriously oversized, and GrandPerspective or OmniDiskSweeper should help you home in on those.

I know my space hogging problem. It’s duplicate files and folders. I have not found a utility that can intelligently scan a directory (say Documents) and scan for exact duplicate files and folders – and then make it easy to duplicate. I’d be happy with a being able to delete duplicate folders, providing they are identical in terms of each file inside the directory. I can’t imagine the disk savings available if that was easy to use. No, I don’t want a monster list of files i have to select individually to delete!

A quick search finds a MacWorld article with several suggestions:

It shows you a few simple things you can do with the Finder and then reviews four apps.

If I needed to roll my own, I’d probably write a script to generate a SHA-512 hash for every file under a specified location (e.g. ~/Documents). The bundled shasum command can be used to do this. (The SHA-512 algorithm is probably overkill, but I don’t want any false-positives).

Once I have a file containing a set of file-path/hash pairs, I can load it into a spreadsheet, sort the rows by hash values and look for identical hashes - these are almost certainly duplicate files. I can then decide which to keep and which to trash.

Over on his blog, @mjtsai wrote:

Removing local copies of iCloud Drive files is not great because then they are no longer backed up. You can do this in a pinch, but I don’t think it’s a good long-term plan.

I’ve been thinking about this, and I wanted to explore the topic a little more here.

There are many possible scenarios with iCloud Drive files, including one Mac or multiple Macs, Optimize Mac Storage turned on in some places and not others, Time Machine backing up some Macs and not others, etc.

The guaranteed way of ensuring that iCloud Drive files are backed up at all times is to have the Mac that backs up via Time Machine keep Optimize Mac Storage turned off.

That’s basically what I recommend in the article for Optimize Mac Storage in Photos for the same reason. When Optimize Mac Storage is turned off, all files are local and will be backed up. Any files added or changed on other Macs will sync locally and will also be backed up.

So what if you need to reclaim space on the Mac that backs up via Time Machine? You can turn Optimize Mac Storage on, wait for it to catch up with you (Howard Oakley says this should be relatively quick if you’re not upgrading to Sonoma in the same process), and then evict folders to reclaim space by Control-clicking them and choosing Remove Download.

However, evicting them doesn’t remove them from the Time Machine backup, so they remain backed up. If you add or change any files in iCloud Drive, those have to be local because they’re actively being worked on, so they’ll also get backed up by Time Machine. I don’t know if there’s a scenario where Time Machine would trim those backed-up files after enough time, but it certainly wouldn’t happen for quite a while.

For the single Mac scenario, as long as you start with Optimize Mac Storage turned off, get a full backup of everything, and then turn Optimize Mac Storage on, files in iCloud Drive should remain backed up.

What about a multiple Mac scenario? To test this, I created and modified files on my iMac in a shared iCloud Drive folder and then looked at the folder on my MacBook Air, which has Optimize Mac Storage enabled and is backing up via Time Machine. Files that I added to the shared folder from the iMac were immediately copied locally to the MacBook Air and then backed up via Time Machine. So new files are protected.

In a multiple Mac scenario, files added from another Mac are made local and backed up by Time Machine.

Changed files seem to be a different story, though, and here I’m having trouble. In working with a folder of sacrificial test files that were local on the iMac but cloud-only on the MacBook Air, changes on the iMac sometimes resulted in the file being made local on the MacBook Air, but not other times. Two text files were never made local, but several Pages, Numbers, Keynote, PDF, and PNG files were. But one Pages file wasn’t. And when I removed all the downloads on the MacBook Air and tried changing the files on the iMac again, none of the files became local on the MacBook Air. Augh!!

So I think the only iCloud Drive/Time Machine mismatch comes when you change an existing file on iCloud Drive on another Mac and those changes are not copied locally to the Mac that’s backing up via Time Machine because it has Optimize Mac Storage turned on.

OK, now let’s think about how you could need a backup of such a file. The file exists on the other Mac and in iCloud Drive, so there are at least two copies. In a situation where the Mac is lost or damaged, the iCloud Drive copy remains intact, so a backup isn’t essential at that point. Deleting a file from an iCloud Drive shared folder also isn’t a problem because iCloud Drive retains deleted files for 30 days in a Recently Deleted folder on iCloud.com.

The need for a backup comes if you change (in a bad way) the file from the other Mac and that action is immediately reflected in iCloud Drive. Since there’s no other copy, and no historical copy, you’re out of luck. If iCloud Drive were to suffer catastrophic data loss, that too could require a local backup if all your Macs had Optimize Mac Storage turned on.

In the end, I’ll go back to the first bold bit above: The guaranteed way to keep iCloud Drive data safe is to keep Optimize Mac Storage turned off on a Mac that backs up via Time Machine.

And there went my afternoon. :-)

4 Likes

Don’t waste your time! Space management on the Mac is now largely indeterminate thanks to APFS, Time Machine snapshots, purgeable space, and more, as Howard Oakley explains. These technologies render the Finder-reported number unreliable at any given point in time.

Such a retrograde step - so much for progress!

My 2009 Mac Mini still works well for Photoshop work (upgraded to SSD 10 years ago) it’s on El Capitan and accurately (it appears) informs me of the storage capacity - so manually backing up stuff works well for me.

The APFS ‘feature’ of misreporting available space on modern Macs is one of the main reason’s I don’t look forward to upgrading the Mac - along with the fact I’d lose access to a full version of Photoshop I paid c£700 for ( I use an iPad for internet banking and web stuff requiring a secure browser. )

True……but with today’s you can’t change anything computers…I stand by my long held opinion that as far as RAM and drive space go God has enough, the rest of us are just making do. I got 32GB/2TB in my 14 M1 MBP but will go to 4TB when I upgrade…after all it needs to process photos when I’m on the road and with 2 cameras that do 20 frames per second at 55MB/frame it adds up fast. I’ve already replaced my 2TB on the road back drives with 4TB models.

Nice. I tried Gemini, but irs clunky. I like your idea

I just buy my way out of this dilemma by (1) buying more space on my Macs (macStudio M1 and MBP16 M3); both have 2 TB internal now. (The internal Apple SSDs are faster too.). (2) Then, if I need more space, I have several 4 TB SSDs attached to the macStudio (all my old photos and documents). I am considering buying 4 TB internal when I replace the macStudio. Optimize iCloud is turned off on both systems - that way I can see all my “active” photos on both systems without waiting for downloads. Time Machine is running on both systems, and I run CCC backups about once a week. I figure my time has value, so paying for larger drives has real value for me.

David

I have used Duplicate Detective to review duplicate files and folders. Simple interface. Wish there was something more elegant, but I have not found it. I catalog my disks with NeoFinder, but it hasn’t helped find duplicates even though it has a function to do that. The Find Duplicates in Photos works pretty well, but that is a “do once and done”

First: great article, and very timely for me - thank you.

Second: Via Setapp, I’ve been using CleanMyMacX which has some good embedded tools to uninstall software, reset apps, clear caches, remove unused languages from apps, etc. It also has a “Space Lens” feature that has helped me identify big blobs of data so I can delete them, archive them on my NAS, move them to “cloud only” access in Dropbox/OneDrive/iCloud; etc. The one thing it doesn’t do is the duplicate cleaning you mention - I’m going to follow your lead on that one!

I currently have a large SSD in my MacBook Pro, which has enabled me to be lazy w/r/t paying attention to data sprawl. I’d like to move to a newer MacBook Air but they top out at 2TB - if I get my utilization down enough, I just might be able to make the move.

Thanks for reminding me about Clean My Mac X. I generally trust MacPaw, but I still like to exercise more control over what gets deleted than utilities. In particular, I’m always dubious about deleting languages even though I’ll never need them. It just feels like messing about within an app package is a recipe for some sort of trouble down the road because the package won’t match what would be expected.

1 Like

I’m actually kind of surprised that deleting languages doesn’t break the app’s digital signature.

But maybe it does, but macOS only checks the signature immediately after installation? That seems to be how the quarantine flag works.

But if Apple decides to tighten security and validate signatures every time you launch the app, this could be a problem. At minimum, you’d need to jump through some hoop (like you have to do when running an unsigned app downloaded from the Internet) in order to tell macOS to continue trusting it.

Well, I kept drilling down…and eventually found that the big files were log files — in the Mail Container — several years old. No idea how this came to be. But I deleted them — and all now seems well. Thanks again for the suggestions.

4 Likes

Well, what do you know - Setapp also includes Gemini for duplicate finding. Working on that this week, too.

1 Like

I haven’t had any issues with deleting unused language files and have done it for years. Not sure if it will cause issues at some point, but I’ll cross that bridge when I come to it.

Um, no offense but why bother? How big is your drive?

And . . . perhaps not in your case but modifying apps by removing things or changing things is a very bad idea in this era of signed and vetted apps. If you bought it / them from the App Store it’s a doddle to redownload and replace them after breaking the signature but from a developer’s site? That can take a bit more time to accomplish (particularly when you’ve lost the serial number :slight_smile: ).

Dave

Howard, I’m still using the Sonos 1 controller app. I moved our huge Apple Music libraries to external 12TB WD drive and pointed Sonos to this pathway for the music folders music selection option with the Manage drop down menu. Has been working well.

Thanks Ross, I’ll see if using the S1 app helps.