Easy ways of clearing disk space

Go through the Photos app and cull all the garbage. It amazes me how much crap people keep. Videos they’ll never watch, hundreds or thousands of terrible photos no-one will ever see.

I’m a photographer by trade (long time ago) and I have hardly anything in my Photos library. Be your own harshest critic and eliminate the ‘cruft’.

Indeed, especially since Apple continued selling Sonoma-compatible machines with non-upgradeable 128 GB drives until surprisingly recently, e.g. the 2018 Mac mini and the 2019 MacBook Air.

I’m not sure when exactly the 128 GB configuration of the 2018 mini was dropped, but Apple sold new 2018 minis until January 2023, and new 128 GB MacBook Airs were sold until 2020.

I always start with the app GrandPerspective to get a quick graphical idea of the major space hogs on my disk. If you get it from SourceForge it’s free or $2.99 from the Mac App Store. This will help you decide which of the steps @ace listed would provide the most benefit.

I ran GrandPerspective and the biggest thing it found was that my “Pictures” folder contains both “Photos Library.photoslibrary” and “iPhoto Library.photolibrary”. Is it correct that the migration to Photos means that the iPhoto version is disposable? (I’m in Sonoma and haven’t intentionally used iPhoto in years–just want to make sure that the original conversion to Photos swept up everything and that there’s nothing lurking that will get confused if the old file goes away.)

Dave

I agree. That was a good app.

TL;DR: Yes. But disposing it won’t free much space because most of the image files are shared between the two libraries. See below for the details.

When Photos migrates an iPhoto library, the new library has hard-links to the same image files that the old library uses. So you can delete either one (but not both, obviously) without losing content, and without duplicating all the data.

You can see this from a Terminal session using the du (“disk usage”) command to view the sizes. du understands hard links and doesn’t double-count files if multiple links appear as it runs.

For a quick example of what I’m describing, I’m going to make a directory containing a copy of the system sounds. Then another that contains hard-links to those same sounds:

$ mkdir ~/tmp
$ cd tmp
$ mkdir sounds
$ cp /System/Library/Sounds/* sounds
$ mkdir linked_sounds
$ ln sounds/* linked_sounds

If you do an ls -i (to see the internal inode numbers that represent the actual file storage, you’ll see that the files in the two directories share the same inode numbers - proving that they are two directory entries referencing the same files:

$ ls -i sounds linked_sounds
linked_sounds:
84952759 Basso.aiff		84952766 Morse.aiff
84952760 Blow.aiff		84952767 Ping.aiff
84952761 Bottle.aiff	84952768 Pop.aiff
84952762 Frog.aiff		84952769 Purr.aiff
84952763 Funk.aiff		84952770 Sosumi.aiff
84952764 Glass.aiff		84952771 Submarine.aiff
84952765 Hero.aiff		84952772 Tink.aiff

sounds:
84952759 Basso.aiff		84952766 Morse.aiff
84952760 Blow.aiff		84952767 Ping.aiff
84952761 Bottle.aiff	84952768 Pop.aiff
84952762 Frog.aiff		84952769 Purr.aiff
84952763 Funk.aiff		84952770 Sosumi.aiff
84952764 Glass.aiff		84952771 Submarine.aiff
84952765 Hero.aiff		84952772 Tink.aiff

If I use the du command to view the size of each directory individually, you’ll see that each contains 4.6 MB:

$ du -sh sounds
4.6M	sounds

$ du -sh linked_sounds
4.6M	linked_sounds

But if I tell du to tell me the disk usage for both together, you’ll see that the second (based on the order I list them) will be 0 size, because all of its files were previously counted by the first directory:

$ du -sh sounds linked_sounds
4.6M	sounds
  0B	linked_sounds

$ du -sh linked_sounds sounds
4.6M	linked_sounds
  0B	sounds

You can do the same with your photo libraries, which are just directory trees containing all of the image and database files representing the library. If you run du against them individually, you’ll see a large size (what Grand Perspective reported), but if you run it against them both together, you’ll see that the second will be much smaller - the size of the files that are not shared with the first.

Here’s an example from my system. Photos Library.photoslibrary is the currently-active library. iPhoto Library.migratedphotolibrary is the original library that was used to create the Photos library. But the photos library has been used for several years since the migration (deleting many migrated pictures and importing many new ones), so they no longer have identical content.

Individually, the Photos library is 77 GB and the iPhoto library is 88 GB:

$ du -sh 'Photos Library.photoslibrary'
 77G	Photos Library.photoslibrary

$ du -sh 'iPhoto Library.migratedphotolibrary'
 88G	iPhoto Library.migratedphotolibrary

But if I check the usage of both together:

$ du -sh 'Photos Library.photoslibrary' 'iPhoto Library.migratedphotolibrary'
 77G	Photos Library.photoslibrary
 24G	iPhoto Library.migratedphotolibrary

$ du -sh 'iPhoto Library.migratedphotolibrary' 'Photos Library.photoslibrary'
 88G	iPhoto Library.migratedphotolibrary
 13G	Photos Library.photoslibrary

In other words:

  • The Photos library has 13 GB of data that is not present in the migrated iPhoto library
    • So deleting the Photos library would only free up 13 GB of space, not 77 GB.
  • The migrated iPhoto library has 24 GB of data that is not present in the Photos library
    • So deleting the iPhoto library will only free 24 GB of space, not 88 GB.
  • There is 64 GB of data that is shared by both libraries
  • The total disk usage for both libraries is 101 GB (not the 165 GB you’d get by adding together the size of the libraries measured individually).

It also means that if you drag/drop these libraries to new storage volumes (which will probably not preserve the hard links), the result will consume 64 GB more than they did in their original locations. Unless you copy them together using a utility that recognizes the hard-links and can preserve them on the destination device. I don’t know if any common Mac utilities (Finder? CCC?) will do this.

Unfortunately, accurately representing this sort of thing can be really tricky, so I’m not surprised that Grand Perspective (or any other tool, I assume) double-counts shared storage.

I think it would be really hard to present this data in a way that shows how two directories/packages are large individually but share a lot of storage with each other.

5 Likes

That was exceptionally helpful and detailed – thanks! It still freed up multiple GB of space, so I’m happy about that.

Dave

I have a MacBook Pro (mid 2009) running High Sierra. I just tried to restart holding down the shift key and got the circle with slash. Started back up with the start button on the MBP.

Question: how long do you hold down the shift key? I was still holding AFTER the ding.

All good suggestions Adam.

I keep all of my media, images, video, music and installers as well as a document archive, on an external 5TB drive, with all the appropriate backups, of course. This makes it very flexible to use with different computers if necessary or for travel, etc. This keeps the inflation of storage on the Mac SSD to quite a low level and makes computer migrations faster.

I use Hazel to auto-file a lot of the stuff that ends up on the media drive, mostly by tag, so it makes maintaining it a lot easier than it otherwise would be.

Much more complicated are the big files that I have that are incremental versions - databases and CAD drawings. I tried to devise a way to prune them but it’s too difficult for the gains, so I ended up just archiving them after a time. They have occasionally proved to be life savers.

I’ve been wondering about how that works because I’ve ended up with multiple photo files. That belongs in Adams final article, with appropriate credit to David for great and useful work.

I think Adam’s list also needs to consider the risk of deleting something you want or need. I would loosely break it into two categories: obvious junk and stuff to check before you delete. The first five items and watched videos are obvious junk; Downloads and most of the rest need some care.

As a professional writer who writes about the history of science and technology, I use the Downloads folder as a digital library of valuable information. It’s not well organized (and Apple’s searches are getting less useful over the years) but it’s essential.

I like Michael Paine’s suggestion of moving photos, music and video collections to an external drive. I have done it already for the music I copied from old reel to reel tapes, and am working on some of my document archives.

You did it the right way. You hold down before the ding and until you get a progress indicator.

It should work on High Sierra. I would try a NVRAM reset. cmd-alt-P-R before the first ding and four dings then let go of the keys. Let it boot and then restart with shift.

This is especially a good idea for videos. I use Handbrake to compress them way down, often by 75%-80% smaller. The difference might be visible on a big screen, but you hardly notice it when viewed on a computer.

I’ve created a Smart Folder that shows all files larger than (for instance) 500MB, which makes it easy to check for low-hanging (but large) fruit.

1 Like

Hi! I have found that apps like AppCleaner do not remove all the associated files, especially those buried deep in the system ƒ.

To find these files, I use “EasyFind” from DEVONtechnologies LLC.

Now the really TERRIBLE developers sometimes preclude from deleting their files by protecting them under SIP. I try to avoid these developers.

Lastly, be wary of “unistallers” from the developer that gave you the installer. I have yet to find one that removed every remnant.

The problem is that it’s a no-win scenario for the developers.

Some people uninstall apps with the intention of reinstalling them later. So you want to preserve preferences and some data files (e.g. custom document templates, spell-check dictionaries, etc.)

And some people uninstall apps with the intention of completely wiping it - so they want to remove everything that was installed, including reverting any changes to system-level databases.

And some people change their minds after uninstalling.

No matter what they do, some users will be upset.

I’ve seen a few (not many) apps where the uninstaller asks if you want to preserve preferences and settings or do a complete wipe. I wish we could see more of this.

This is one of the advantages of the App Store. When the entire app is sandboxed, deleting that sandbox should wipe everything, except for documents you explicitly saved to a non-sandbox location.

But ultimately, app developers need to conform to some kind of standard practice. Perhaps:

  • The app and all support files that never change should be part of the application bundle itself (/Applications/AppName.app)
  • Support files that may change, but are shared by multiple users (e.g. plugins, optionally-installed features) should go in /Library/Application Support/AppName, where “AppName” matches the name of the app.
  • Support files that may change, but are per-user (e.g. per-user plugins, custom dictionaries, etc.) should go in ~/Library/Application Support/AppName.
  • Preferences (including toolbar customization, plugin activation/configuration, window positions, etc.), should be stored in ~/Library/Preferences/AppName.plist.

And that should be about it. Everything else should be documents, saved to locations of the user’s choice.

But far too many developers do other things for various reasons which probably make sense to them. So the above is just a pipe dream that probably will never become universal.

4 Likes

I cleared many gigabytes of disk space by simply resetting my podcast settings. It took a while, but I had ignored the pod settings and the default was not good

2 Likes

Agree. One complication is that people have thousands of photos on their phones and then back them up or copy them to their Photo library on their Macs, so they have TWO copies of every shitty photo. Ouch!

However, I find it easier to sort out bad photos on a Mac but then, how do you clean up the photos on your phone?

I downloaded St. Claire Software’s GO64 which can filter and show 32-bit, Intel, and Apple Silicon apps. I found all sorts of garbage apps on my M2 MacBook Pro, which I deleted with CleanMyMac (CMM).

However, CMM cannot delete system files, kexts, application support files, and other garbage from apps which I deleted manually over the years.

Migration assistant and/or CMM need to be made much smarter. I found system files going back to 2009 – belonging to apps like the one I used to print labels and case inserts for CDs. I’m a pretty savvy user so I started going through everything, but an average Mac user cannot even begin to suss out how to clean out the dead wood.

Check CCleaner if you are looking for a fast way to find cruft. I just launched mine and in less than 5-6 seconds 4.55 GB of file and memory space were found for deletion. CCleaner finds it and presents a prechecked list of cache, log files, trash, cookies, and web cache that can be deleted. [I am hesitant to delete cookies and uncheck that list.] Periodically a popup will advise you that there is a new batch of files to clean up.

It has a Professional license for advanced features.

Rather than my writing about all the features, it would be simpler for you to install the app, look it over, and delete it if you do not find it helpful.

PS. I’m stuck here at Big Sur.