MacOS Big Sur currently has an upgrade issue. In certain situations, the upgrade will fail and then get stuck with a neverending progress bar.
UPDATE! This issue is fixed in both the Monterey 12.1 and Big Sur 11.6.2 Full installer.
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
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
- Different situations. The macOS stuck progress bar issue has many different situations.
- How can I check how many mdworker files my system has before an upgrade.
- I have more than 20,000 files. How do I clear them out before the upgrade?
- The files have been deleted! Now what?
- What if you booted your failed Mac into safe mode after having the issue?
- Will Apple fix this problem?
- Final Thoughts
- Thank you!
1. Different Situations
- 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.
- 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.
- Your upgrade has already Failed – If your upgrade has already failed you can rescue it!
- 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.
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
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”
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.
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.
NOTE ON DIFFERENT LANGUAGES!!! The word DATA is different in your language. For example, in French it is “Macintosh HD – Données” If you are unsure, you can look in disk utility or run this command
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
find command might take a LONG time. You can hit it
control c to quit the command and it will still give you a number. If the number is large, you know that you have the problem and don’t have to wait for the entire count.
Notice the folder structure has changed. When a upgrade gets stuck in this situation, the /private/var/folder is in the
Previous System folder.
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. We have 2 different situations. The first one is if your Mac has not failed the upgrade and you want to delete the files to prevent a problem. The 2nd one is if your Mac has already failed the upgrade.
- If your Mac has not failed the upgrade yet
You can run both commands to remove the problematic directories.
rm -rf /private/var/folders/*/*/C/com.apple.mdworker.bundle rm -rf /private/var/folders/*/*/C/com.apple.metadata.mdworker
Or run both find 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
You might not need to use
sudo . If you get an error just take that part off and run
NOTE: Both the
rm and the
find command might take a LONG time.
When finished, go to the section 4
- Your Mac has already failed the upgrade.
Run both commands from macOS recovery terminal.
rm -rf /Volumes/Macintosh HD - Data/Previous System/private/var/folders/*/*/C/com.apple.mdworker.bundle rm -rf /Volumes/Macintosh HD - Data/Previous System/private/var/folders/*/*/C/com.apple.metadata.mdworker
Or you can use find to delete them
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
find command might take a LONG time.
You will know the commands worked when the command prompt appears again. This means the command finished successfully.
When finished 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.
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!
+ Everyone else that helped with the macos stuck progress bar issue. 👍