macOS Upgrade to Big Sur Failed! Stuck Progress Bar fix & Prevention!

macOS Mojave or Catalina to Big Sur Upgrade Progress Bar Stuck Fix.

MacOS Big Sur currently has an upgrade issue. In certain situations, the upgrade will fail and then get stuck with a neverending progress bar.

I’ll start with a quick summary of the macOS stuck progress bar situation.

If you are upgrading from macOS High Sierra, Mojave, or Catalina to Big Sur your upgrade could fail if it matches a very particular condition.

If folders in multiple directories in the location below

/private/var/folders/*/*/C/com.apple.metadata.mdworker

have more than 20,000 files your upgrade could fail.

In some situations users have reported 500,000 – 2,000,000 files!!!

This is the reason why the problem could never be reproduced.

If you build a fresh system the file counts for spotlight will be very low. You might have 20-400 entries. This would allow the upgrad to finish properly.

Table of contents

  1. Different situations. The macOS stuck progress bar issue has many different situations.
  2. How can I check how many mdworker files my system has before an upgrade.
  3. I have more than 20,000 files. How do I clear them out before the upgrade?
  4. The files have been deleted! Now what?
  5. What if you booted your failed Mac into safe mode after having the issue?
  6. Will Apple fix this problem?
  7. Final Thoughts
  8. Thank you!

1. Different Situations

  1. Why check? Just because your upgrade failed does not mean that this is the exact issue. Sadly upgrades could fail for multiple reasons. This article is for one very specific issue that usually affects Macs that have been in service for a long time.
  2. Your Mac hasn’t started the upgrade yet. You can prevent the problem from happening by clearing out the files in that folder before upgrading.
  3. Your upgrade has already Failed – If your upgrade has already failed you can rescue it!
  4. System that has failed but was started up with Safe Mode – Your upgrade failed and you used Safe Mode to troubleshoot. You will need to recreate the user account.

I’ll go over each situation below.

2. How can I check how many mdworker files my system has before an upgrade.

We have two situations here. If your Mac Upgrade has already failed. The 2nd situation is you are planning an upgrade and want to make sure it does not fail.

1. If you did not start the upgrade yet and want to check to see if your Mac is affected.

Run this command to check how many mdworker files you have.

sudo find /private/var/folders/*/*/C/com.apple.metadata.mdworker -type d | wc -l

The command could take some time to run depending on how many files your system has. Below is an example of a system that is ready for an upgrade.

MrMacintosh.com -
What the command will look like after it completes.

If you are under 20,000 files, you should be good to go for the upgrade. If the file count is larger then you will need to clear out these files. (See section

2. If your Mac has already failed the upgrade.

You will need to run the command in macOS recovery or through Target Disk Mode with a 2nd Mac.

I’ll start by showing you how to check in macOS recovery.

Boot your Mac to recovery. Power it down then back up while holding down command R

Once you are in recovery, you might be asked to authenticate if your Mac is encrypted with FileVault 2 or Find My Mac. Do so, and then you will be at the main recovery screen.

Click Disk utility. You might have to mount “Macintosh HD – Data”

This is what disk utility might look like when you open it.

Both Macintosh HD and Macintosh HD – Data might be mounted. If they are greyed out then you will need to mount them. If they are already mounted, you can continue to the next section.

You can also click “View” from the menu bar and then select “Show all devices”. Click on Macintosh HD – Data and then click the Mount Button.

Clicking on Macintosh HD – Data to mount it.
Entering in the password for Macintosh HD – Data

Now that you have made sure Macintosh HD – Data is mounted, you can quit disk utilities and open up terminal from the utilities in the menu bar at the top.

Once in terminal, you can run this command to check to see how many mdworker files your Mac has.

find /Volumes/Macintosh\ HD\ -\ Data/Previous\ System/private/var/folders/*/*/C/com.apple.metadata.mdworker -type d | wc -l

find /Volumes/Macintosh\ HD\ -\ Data/Previous\ System/private/var/folders/*/*/C/com.apple.mdworker.bundle -type d | wc -l

Notice the folder structure has changed. When a upgrade gets stuck in this situation, the /private/var/folder is in the Previous System folder.

The command could take a long time to come back with a number. It should look something like this.

This system has 1,790,715 mdworker spotlight files. Notice the error, you can leave off the -type d from the command.

Now we know that this system is affected because it has 1,790,715 mdworker spotlight files.

3. I have more than 20,000 files. How do I clear them out before the upgrade?

Now that we know our system is affected we can delete them

  1. If your Mac has not failed the upgrade yet.

Run both commands

sudo find /private/var/folders/*/*/C/com.apple.mdworker.bundle -mindepth 1 -delete
sudo find /private/var/folders/*/*/C/com.apple.metadata.mdworker -mindepth 1 -delete 

Go to the section 4

  1. Your Mac has already failed the upgrade.

Run both commands from macOS recovery terminal.

find /Volumes/Macintosh\ HD\ -\ Data/Previous\ System/private/var/folders/*/*/C/com.apple.mdworker.bundle -mindepth 1 -delete
sudo find /Volumes/Macintosh\ HD\ -\ Data/Previous\ System/private/var/folders/*/*/C/ com.apple.metadata.mdworker -mindepth 1 -delete

You will know the commands worked when the command prompt appears again.

Go to section 4

4. The files have been deleted! Now what?

You have successfully checked the file count and cleared the excess file count.

If you removed the files before the upgrade you should be ready to go for a safe upgrade. Make sure that you always backup your files before any upgrade.

If your Mac had a failed upgrade, all you need to do is reboot and the upgrade should finish!!!

5. If your Mac failed the upgrade & you booted up in Safe Mode

In this situation, if you booted a failed upgrade with safe mode it would have started the Setup Assistant. If you created a new user, you would find that the previous user on the system was gone. The good news is, the user home folder is still there. All you will need to do is boot to recovery, remove the extra files mentioned above so the upgrade can finish. Once the upgrade finishes, you can add the user back. This is taking into account that you have a service account or admin account on the Mac. If not, you might have to pull the data off the system and reinstall macOS.

6. Will Apple fix this issue?

I think they will.

The fix will require a new full installer. You know by now that I’m a big fan of macOS full installers. I hope that Apple will continue to release them for each update.

I will let you know and update this article when the issue is fixed.

6. Final thoughts

This problem has been plaguing users since at least July of 2021. This means that the issue in the big sur installer could go all the way back to 11.4 or 11.5.

Jeff Johnson wrote about this exact issue back in August of this year.

https://lapcatsoftware.com/articles/macBS.html

At the very end of the article, he says this.

I still don’t know why my Big Sur update got stuck. I don’t think I’ll ever know.

Sadly this article did not come in time for you Jeff, but at least now you know what happened. Maybe this article will help save others until Apple fixes this issue.

7. Thank You

This issue was a huge group effort from multiple #MacAdmins.

A few weeks ago, I started putting pieces together that this was not an isolated issue.

I created the #MacAdmins Slack channel #mojave_upgrade_problem. In this channel is where multiple experts came together with information to help solve this issue.

In the end, after giving Apple Engineers a ton of information, they came back with a folder location to check for files. From that info, we figured out that if we removed the excess files the upgrade would finish!

Thank you

  1. Apple Engineering
  2. stevemaser
  3. bradtchapman
  4. paulfank 
  5. atlauren
  6. Jeff 
  7. ljcacioppo
  8. gmarnin
  9. magnusviri 

+ Everyone else that helped with the macos stuck progress bar issue. 👍

Leave a Reply