When you need to go back to square one and return to a ‘clean’ installation of macOS, simply re-installing macOS is insufficient: what you need is a clean re-install. It’s clean because it isn’t simply installed on top of your existing files, and it’s a re-install because those system files are there already.
In Mojave and earlier, a clean re-install is straightforward if time-consuming. You boot into Recovery Mode, use Disk Utility there to wipe your boot volume, then re-install macOS from the main window. What determines the source and version of macOS to be re-installed are the keys you hold down to enter the mode in the first place.
Try this in Catalina and the first thing you’ll realise is that you don’t just have a single boot volume now, you’ve got two, one called something like
Macintosh HD, the other
Macintosh HD - Data. The first of those is the read-only System volume, and the second the read-write Data volume. Because you want to re-install macOS, the logical thing to do would be to wipe the System volume, which suggests that you could get away with retaining your own files on the Data volume through a clean re-install. Sadly, that’s wrong and will fail.
To perform a clean re-install in Catalina, once in Recovery Mode, you need to delete your Data volume, that’s the one named
Macintosh HD - Data, or something similar if you’re using a custom name, and to erase your System volume.
In Recovery Mode select the
Macintosh HD - Data volume at the left of Disk Utility’s window then use the Delete APFS Volume command from the Edit menu, or use the shortcut by clicking the – tool.
Once that’s deleted, you’ll then need to erase the System volume, by selecting it at the left and clicking on the Erase tool. This is described by Apple in this detailed support note, but commonly fails with an error reporting that ‘The volume “Macintosh HD” on disk2s5 couldn’t be unmounted because it is in use by the process 734 (kextcache)’. If that happens, restart into Recovery mode and repeat the process of erasing the System volume, which should succeed on the second try.
If you’re performing this clean re-install to try to fix a problem, and don’t want to make its current data particularly inaccessible, then all you should need to do is select the Data volume and erase it; when you re-install macOS that should overwrite everything on the System volume, which is, after all, read-only in normal use. However, as of 10.15.2 that doesn’t work, and results in the creation of yet another Data volume named Macintosh HD – Data – Data.
Deleting the Data volume does make a difference to the end result: when you delete the Data volume then add it back, its Unix-style volume number has changed, perhaps from 2 to 1, and that of the System volume goes from 1 to 5. This shouldn’t make any practical difference, but may be confusing if you ever need to refer to volumes using those numbers.
With your volumes prepared, now comes the time-consuming step of re-installing the system on them. At one time, the Recovery volume contained sufficient to restore the current version of macOS if you have entered ‘local’ Recovery Mode using Command-R, but this doesn’t seem to work any more. Whichever type of re-installation you have set now requires that version of macOS to be downloaded afresh.
Depending on which version of Catalina it’s running and how you erased volumes using Disk Utility, you may be presented with a choice of volumes on which to install macOS, which could be a surprise. If you try to install macOS onto the original System volume,
Macintosh HD, you’ll discover that’s not possible, so select the Data volume here,
Macintosh HD - Data instead.
Apple explains in this article.
What could possibly go wrong?
The commonest and most peculiar problems arise when the installer gets overenthusiastic about creating new Data volumes, and you end up with additional volumes with names like
Macintosh HD - Data - Data. Once macOS has completed the installation, it’s worth opening Disk Utility to check that you have the System and Data volumes you expect, and no more.
If you have too many Data volumes, it’s best restarting back in Recovery Mode, opening Disk Utility there, and going back through the process of deleting and erasing volumes again. Delete all the Data volumes and erase (not delete) the System volume, then re-install. This may seem a pain, but it’s worth getting your volumes straight before going any further, or you’ll only store up problems for the future.
Unfortunately, once you have started your clean re-install, there’s no way to check that everything is going OK until macOS has been fully configured. Exiting the install process at the start of its customisation steps doesn’t leave your Mac in a position to be able to mount as a Target Disk, for example.
Using an external disk
To take your internal storage right back to the beginning and set it up from scratch, you should be able to do this when booted into either of the ‘remote’ Recovery Modes, but it’s most reliably done when booted from an external disk. The reason that this is now unpopular is that, if your Mac has a T2 chip, you can’t boot it from an external disk without entering Recovery Mode first to enable that, rather then running in the default Secure Boot mode.
Once booted from that external disk, you can then use Disk Utility to erase the whole internal storage back to a GUID Partition Map, then run the macOS installer of your choice to install macOS onto it, during which it will create the various volumes it requires. This is then the squeakiest clean of clean re-installs, but should very seldom be necessary.
Thanks to Vladislav for information about the difference between volume numbering according to the procedure used.
Updated 21 December 2019 with corrections from field testing.