Removing Unremovable Files after Upgrading to macOS Catalina
Against the better judgement of my own common sense, I decided to update my iMac to the macOS Catalina beta recently. One of the major internal changes in going from Mojave to Catalina is the transition to a read-only System volume. During this process, I ended up with a folder on my desktop of files that the upgrade was unable to handle. Most of these files seemed innocuous, and I just deleted them. There was one folder, however, that I couldn’t delete because the system claimed it wasn’t empty. Blowing it out via the Finder or the Terminal was a fruitless task.
In the interest of saving you time if you run into this scenario, these are the steps I took to solve my issue.
- Reboot your Mac into Recovery Mode. Authenticate your user account if required.
- From the menu bar, open the Terminal application.
- Disable System Integrity Protection and reboot:
csrutil disable; reboot. - Once your Mac reboots (and assuming it's still not in recovery mode), open the Terminal app.
- You need to mount the new file system as read-write temporarily so we can blow the folder(s) away:
sudo mount -uw /. This is temporary, and rebooting will revert back to the safer read-only variant. - Delete the files you want to purge via the
rmcommand. You’ll probably need to usesudo. - As a last step, you need to re-enable System Integrity Protection. To do that, reboot back into Recovery mode.
- From the Recovery Mode menu bar, open the Terminal application:
csrutil enable; reboot
Once the reboot completes, your Mac should be back to the expected state, just with a few less zombie folders. You can verify SIP is active by opening Terminal and executing the csrutil status command.