Saturday, November 21, 2020

macOS Mojave Safe Mode can take hours, the progress bar is no help. Also - Disk Utility and APFS

 TL;DR

What happened

When I'm doing a major macOS update I typically backup two different ways, unplug everything, do a Safe Mode start to clean caches and verify directory structures, run a hardware diagnostic startup, then I update. This time around I was just applying the latest Mojave update but I decided to do a safe mode start for the heck of it.

Safe mode's progress bar smoothly progressed to 100%. And then it sat there. For an hour or two. Finally I gave up and powered down. Clearly something was wrong.

I ran a hardware diagnostic (startup D). No problems.

I booted in Recover Mode and ran Disk Utility. It quickly finished. No problems. (But this was a mistake.)

I googled and found basically nothing (crank note below).

Finally ... something clued me to look more closely at Disk Utility. The partition that First Aid ran against was only a few GB. That made me look around a bit. I can't recall the exact sequence but I had to do something in the menu bar to show all possible partitions. Then I had to select a drive/partition thing to mount it. That required a password for at least one user (I gave it my admin user password). Then I could see the true 250GB data drive. Then I ran Disk Utility First Aid on that ... and it took about 15-30 min for each of 19 Time Machine snapshots. In all it took about 4 hours to run.

That night I boosted into Safe Mode before leaving the computer. When I got up it had completed without a problem.

Basically that progress bar is a bug. (macOS is infamous for missing and misleading progress bars.) In Mojave Disk Utility Safe Mode seems to run Disk Utility First Aid on all partitions/volumes at the very end of its execution when the progress bar is complete -- and that can take many hours. Even if there are no problems. If Safe Mode runs overnight and still hangs then you need to run Disk Utility First Aid to figure out where the problem is -- including running it on all partitions/volumes.

A crank footnote

Fifteen years ago when I ran into similar problems a quick Google search would have returned many blog posts and forum comments explaining the problem. In 2020 my searches turned up a single cryptic Apple Discussion post saying safe mode took a "long time" to complete. I figured an hour was a "long time", but it looks like 8 hours is conceivable. The modern web is decrepit. I doubt, for example, that Google will actually index this particular post. (Update 11/13/2023 - After the Aperture nightmare was done I started Safe Mode prior to doing a Monterey update. After an hour I googled on the problem and found my article. So now I'm gonna kill it and remove the snapshots with Carbon Copy Cloner then run safe mode. Anyway, Google evidently indexed this post!)

No comments: