Removing cloud storage providers from macOS

One of Apple’s most annoying habits is changing things to make them harder for users to “make mistakes”. Almost without exception, these actually degrade the user experience in one way or another.

A case in point is the changes that Apple made a while ago to how third-party cloud storage providers such as Dropbox, OneDrive, and Proton Drive create and store their files. In the past, these were held in common or garden directories in the user’s folder – so, for example, OneDrive used to store its files in /Users/ianbetteridge/OneDrive. You could even change this location if you wanted to put it somewhere else.

That, obviously, was too simple for Apple. Now, the “approved” way of being a cloud storage provider is to store files in /User/Library/CloudStorage. This uses the macOS File Provider extension rather than custom kernel extensions, and Apple has indicted it will get rid of custom kernel extensions at some point. It hasn’t happened yet, and some storage providers – notably Nextcloud – still use the old method.

The drawback of this is that the CloudStorage director is, like everything in /Library, hidden. You can’t get to it without either holding down option and selecting the Go menu in the Finder or using the terminal. That means if you remove a cloud provider’s drive from the Locations bar in the Finder windows, you have a fun time trying to find those files again.

More importantly, if you remove a provider, it’s hit or miss whether your files will also be removed. I’ve seen instances where deleting a cloud storage provider’s application also asks if you want to delete the locally stored files. But more often, those files will just stick around, in a directory you can no longer easily access, hogging disk space.

That’s fine as long as you have infinite disk space and didn’t locally cache many files. But I like my files local where possible, which means if I delete, say, OneDrive (which has tens of gigabytes of files in it) I just lose that disk space.

However, I hear you say, can’t you just navigate to them and delete the directory? Well, no: Apple (helpfully, again) locks those directories against deletion in the Finder. You can delete the files in them, but the folder itself sticks around like a bad smell. And if you reinstall the cloud storage provider again, things seem to break: when I tried this, the folder refused to sync, and of course, couldn’t just be moved, and if it did appear to sync files didn’t open because the Finder was confused about their sync status.

Thank you, Apple. You have replaced well-written kernel extensions with your own “universal” version, which actually works less reliably. Well done, people.

Thankfully, you can completely delete a folder. You just have to go to the terminal and do a little bit of Unix to do it.

  1. Open a terminal, and go to the CloudStorage folder – for me, this means typing “cd /Users/ianbetteridge/Library/CloudStorage”, but you will obviously have to replace that with your username.
  2. Type “ls” – this gives you a list of what directories are in there. For example, I have folders called OneDrive-IanBetteridge and Dropbox, for the two cloud storage providers I use.
  3. Now the dangerous bit. Type “sudo rm -r NameOfDirectoryToDelete” (replacing, of course, “NameOfDirectoryToDelete” with the name of the folder you wanted deleting). Terminal can autocomplete names, so you can just type the first few letters of a unique name, hit tab, and it will fill in the rest.
  4. Hit return, and you will be asked for your password. Type it in, hit return again, and that directory and all its contents are gone from your Mac, for good, with no real possibility of getting them back. So really do make sure that you’re deleting the directory that you want.

 And that is what I mean about Apple’s ability to make things less usable. If I was able to just navigate to the folder in the Finder and delete it normally, it would be in the Bin and so, if I make an mistake, easier to recover. But because Apple first instinct every time is to “protect” users and “make it easier”, you need to go to the command line and use a Unix tool which is far more user-hostile and dangerous.

Thanks Apple.

Ian Betteridge @ianbetteridge