Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

michaelafcadio

macrumors member
Apr 21, 2019
50
5
Boston, MA
I'm a complete novice when it comes to entering code. Could you possibly upload this in the exact way it's supposed to be entered into the Terminal because I keep trying to enter it but mostly all I ever get is "No such file or directory found" or something like that.

Sorry for the late reply. The commands included above in this post, are the exact commands to type into the terminal, assuming your startup disk is the default name, "Macintosh HD". If you've renamed your startup disk, you will need to replace the startup disk name in step 4:
Code:
cd /Volumes/Macintosh\ HD/System/Library/Extensions

E.g., if you've renamed your startup disk, "Mac SSD", then step 4 would be:
Code:
cd /Volumes/Mac\ SSD/System/Library/Extensions

(The backslash ("\") is needed before the space character in the name of the disk.)

For macOS Catalina, assuming your MacBook uses the default startup disk name from Apple ("Macintosh HD"), the following are the complete commands to type at the Terminal prompt once launched from Recovery Mode:
Code:
cd /Volumes/Macintosh\ HD/System/Library/Extensions
mv AppleThunderboltNHI.kext AppleThunderboltNHI.kext.BAK
mv AppleThunderboltPCIAdapters.kext AppleThunderboltPCIAdapters.kext.BAK
mv AppleThunderboltDPAdapters.kext AppleThunderboltDPAdapters.kext.BAK
mv AppleThunderboltEDMService.kext AppleThunderboltEDMService.kext.BAK
mv AppleThunderboltIP.kext AppleThunderboltIP.kext.BAK
mv AppleThunderboltUTDM.kext AppleThunderboltUTDM.kext.BAK
 
Last edited:

michaelafcadio

macrumors member
Apr 21, 2019
50
5
Boston, MA
I did the fix for Catalina version 10.15.3 as written above, confirmed that each AppleThunderbolt*.kext driver was rewritten as AppleThunderbolt*.kext.BAK and thought the problem was solved. However just a few moments ago the fans spun up to maximum and the computer shut itself off just as it has done so many times before. Does anyone have any idea of what to do now?

Ouch. From my experience, this most likely happens when one of the Thunderbolt drivers wasn't renamed as you expected. When you get a chance, type the following command at the Terminal (after booting normally from the startup disk):
Code:
ls -ld /System/Library/Extensions/AppleThunderbolt*

You want to verify that all of the resulting files displayed end in ".kext.BAK" like this:
Code:
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:50 /System/Library/Extensions/AppleThunderboltDPAdapters.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:52 /System/Library/Extensions/AppleThunderboltEDMService.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:51 /System/Library/Extensions/AppleThunderboltIP.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:50 /System/Library/Extensions/AppleThunderboltNHI.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:50 /System/Library/Extensions/AppleThunderboltPCIAdapters.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:51 /System/Library/Extensions/AppleThunderboltUTDM.kext.BAK

If you see any files ending in ".ktext" without the ".BAK" then you'll need to boot into Recovery Mode and perform the rename again.

Also, and this is VERY IMPORTANT and applies to everyone relying on this fix:

Each time you perform a macOS update, you will need to repeat these procedures because the macOS update will overwrite the renaming of the Thunderbolt drivers!!! Yeah, this sucks. Big time.​

Lastly, this "fix" sadly means that you cannot use any Thunderbolt devices such as a Thunderbolt dock or display. ??
 
Last edited:

Watchman314

macrumors newbie
Mar 22, 2020
3
0
Ouch. From my experience, this most likely happens when one of the Thunderbolt drivers wasn't renamed as you expected. When you get a chance, type the following command at the Terminal (after booting normally from the startup disk):
Code:
ls -ld /System/Library/Extensions/AppleThunderbolt*

You want to verify that all of the resulting files displayed end in ".kext.BAK" like this:
Code:
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:50 /System/Library/Extensions/AppleThunderboltDPAdapters.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:52 /System/Library/Extensions/AppleThunderboltEDMService.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:51 /System/Library/Extensions/AppleThunderboltIP.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:50 /System/Library/Extensions/AppleThunderboltNHI.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:50 /System/Library/Extensions/AppleThunderboltPCIAdapters.kext.BAK
drwxr-xr-x@ 3 root  wheel  96 Jan 21 00:51 /System/Library/Extensions/AppleThunderboltUTDM.kext.BAK

If you see any files ending in ".ktext" without the ".BAK" then you'll need to boot into Recovery Mode and perform the rename again.

Also, and this is VERY IMPORTANT and applies to everyone relying on this fix:

Each time you perform a macOS update, you will need to repeat these procedures because the macOS update will overwrite the renaming of the Thunderbolt drivers!!! Yeah, this sucks. Big time.​

Lastly, this "fix" sadly means that you cannot use any Thunderbolt devices such as a Thunderbolt dock or display. ??
Got it. I did this and can confirm that everything has been renamed properly. I even went ahead and renamed the IOThunderboltFamily.kext file. The issue still persists. Don't know if I did something wrong or if my MBP is just unfixable.
 

michaelafcadio

macrumors member
Apr 21, 2019
50
5
Boston, MA
Sorry to hear that @Watchman314. Have you tried the Python/busy-wait loop trick to keep the processor busy?

I can't find a link to the Python code, but below this is what worked for me. You'll need to copy the code into a file and name it something like mbnocrash.py:

Python:
#!/usr/bin/env python
from time import sleep

sleeptime=0.0001
while True:
    sleep(sleeptime)

Once you have this saved in a file named mbnocrash.py, you'll need to make it executable by typing this command at the Terminal:
Code:
chmod +x mbnocrash.py

Then, you can run the program from the Terminal like this:
Code:
./mbnocrash.py

This will run forever and hopefully prevent the MacBook from crashing.

You can experiment with the sleeptime parameter to find an optimal value that prevents crashing but doesn't take up too much CPU resources. I find that values between 0.0001 and 0.0002 work well and only use between 5-7% CPU. Larger values of sleeptime will take up less CPU but do not appear to be as effective at preventing crashing. If 0.0001 and 0.0002 do not prevent crashing, try again with 0.00002.

I hope this works for you.

UPDATE: I believe I copied the above Python code from this post by @jerry008:
 
Last edited:

owenchristian

macrumors newbie
May 27, 2020
4
2
[Update: I just upgraded my late 2013 15" RMBP to the newest software, 10.15.5, and somehow, no more shutdowns!

I was having the same issue with shutdowns which were fixed with the method of renaming AppleThunderboltNHI.kext to the .BAK filename. I had to do this for the past few iterations of Catalina to keep from crashing.

However...this time I waited to see it it would crash after the update, and it has been stable for a few hours now. The AppleThunderboltNHI.kext is in its normal location, untampered with.]


Just kidding. I ran 10.15.5 for a full day, but then shutdowns started again. And this time, just renaming the AppleThunderboltNHI.kext didn't solve the problem--I had to rename all the kext files, and I'm still not sure if that will be a lasting fix. So, updating to 10.15.5 actually made the problem worse!
 
Last edited:

amnesia106

macrumors newbie
Jun 5, 2018
23
8
Harzvier
That sounds good. Could you report again after a while? I’m on 10.15.3 - with 10.15.4 the shutdowns still there, and rename of the thunderbolt files don’t fix this.

Update: I just upgraded my late 2013 15" RMBP to the newest software, 10.15.5, and somehow, no more shutdowns!

I was having the same issue with shutdowns which were fixed with the method of renaming AppleThunderboltNHI.kext to the .BAK filename. I had to do this for the past few iterations of Catalina to keep from crashing.

However...this time I waited to see it it would crash after the update, and it has been stable for a few hours now. The AppleThunderboltNHI.kext is in its normal location, untampered with.
 

Denis K

macrumors newbie
May 28, 2020
8
2
MBP 15 Mid 2014, updated to Catalina 10.15.5 and random shutdowns are back.
Moved all Thunderbolt kext out and still have shutdowns.
Had to use python script.
 
Last edited:

Hollie

macrumors newbie
Dec 4, 2019
7
3
Belgium
Just kidding. I ran 10.15.5 for a full day, but then shutdowns started again. And this time, just renaming the AppleThunderboltNHI.kext didn't solve the problem--I had to rename all the kext files, and I'm still not sure if that will be a lasting fix. So, updating to 10.15.5 actually made the problem worse!

Hello @owenchristian,

can you please be a bit more specific with 'renaming all the kext files' > you mean all AppleThunderboltxxxx.hext files?

And can you please report if the mass rename actually fixed the problem on 10.15.5? I'm still holding onto 10.15.3 on my 'Late 2013' macbook for that reason.

Thanks,
Lieven
 

owenchristian

macrumors newbie
May 27, 2020
4
2
Hi @Hollie,

While running 10.15.4 or 10.15.3 in the past, renaming AppleThunderboltNHI.kext to AppleThunderboltNHI.kext.BAK seemed like a solution and I never had a shutdown afterwards. However, after installing 10.15.5 and renaming this single file, I was still having shutdowns.

Now I have renamed all the following files,

AppleThunderboltNHI.kext.BAK
AppleThunderboltPCIAdapters.kext.BAK
AppleThunderboltDPAdapters.kext.BAK
AppleThunderboltEDMService.kext.BAK
AppleThunderboltIP.kext.BAK
AppleThunderboltUTDM.kext.BAK

and haven't had a shutdown for about a day and a half. Still holding my breath that I don't need to use the python script. In fact I might go back to 10.15.4 to see what happens then.
 

Hollie

macrumors newbie
Dec 4, 2019
7
3
Belgium
Hello @owenchristian ,

thanks for the reply. In fact, I have been renaming all AppleThunderboltXXX.kext files on 10.15.3 from the start. So I have no experience with the effect of renaming only the single NHI file.

I can tell you that I have not seen any negative effects in my setup due to the mass rename.

I am very interested in learning if your computer remains stable on 10.15.5 for some longer time before I take the plunge to update.

Have a nice weekend,
Lieven.
 
  • Like
Reactions: michaelafcadio

Denis K

macrumors newbie
May 28, 2020
8
2
MBP mid-2014, moved all files out to a different folder, no go.
AppleThunderboltNHI.kext
AppleThunderboltPCIAdapters.kext
AppleThunderboltDPAdapters.kext
AppleThunderboltEDMService.kext
AppleThunderboltIP.kext
AppleThunderboltUTDM.kext
IOThunderboltFamily.kext
 

Denis K

macrumors newbie
May 28, 2020
8
2
I've seen a post on Reddit and they suggest to rebuild the pre-linked kernel from Single-User Mode:
mount -uw /
mount -uw /System/Volumes/Data
kextcache -i /
kcditto
reboot

I just did that and over an hour without shutdown(typically shutdowns within 5-15 minutes). Fingers crossed.

MBP mid-2014, moved all files out to a different folder, no go.
AppleThunderboltNHI.kext
AppleThunderboltPCIAdapters.kext
AppleThunderboltDPAdapters.kext
AppleThunderboltEDMService.kext
AppleThunderboltIP.kext
AppleThunderboltUTDM.kext
IOThunderboltFamily.kext
 
Last edited:

Denis K

macrumors newbie
May 28, 2020
8
2
hello Denis,



Hmm, would you care to explain this a bit more in detail please?

Thanks,
Lieven
So, I renamed all Thunderbolt kext files.
Then reboot into single-user mode and did the following:

mount -uw /
mount -uw /System/Volumes/Data
kextcache -i /
kcditto
reboot
 

asb1

macrumors newbie
Jun 8, 2020
20
5
I'd like to bump this thread so we can hopefully find out if this will be an issue on Big Sur!

I have a Late-2013 15" MBP, and have been successfully treating Random Shutdown Syndrome by trashing AppleThunderboltNHIkext. I'm on Mojave, and never upgraded to Catalina because I feared this fix wouldn't work anymore. I've had to remove the driver every time there is a Mojave security update.

This machine is now the oldest generation to support Big Sur, and I would like to upgrade, but am hoping someone can report if this has been fixed!
 

DJSimonR

macrumors newbie
Jan 11, 2018
12
3
Hi guys,

I was having the same issues as you guys since I got my late-2013 MacBook Pro 15" and I have always renamed the AppleThunderboltNHI.kext which has always worked for me.

Last week a decided to upgrade my NVME so I can dual boot Catalina (for work) and Big Sur (for fun). I installed a Crucial 500GB NVME and then partitioned it 200/300GB for each OS. I installed Catalina and then restored from TimeMachine backup, once I had done that I then installed Big Sur and because it took me so long I was just sat in my living room playing around with Big Sur, after about an hour I then realised I had not renamed the .kext file and I was having no issues. I booted back in to Catalina and left the MacBook to idle and usually the crash happens within a few minutes at the most, Nothing happen. I checked the .kext file to see if my restore had changed it but no, it was not renamed and still running.

I have tested this a couple of times over the last few days and I'm getting no crashes. The only thing I have changed is the NVME. Could it be a OEM NVME issue? its very strange that I am no longer having these issues.

I thought maybe it really was a software issue and they had fixed it in Big Sur but both OSes are acting the same.

Just thought I would let people know my experience since changing the drive. Has anybody else changed their drives and are still having the issues?
 

Aaron Morris

macrumors newbie
Jul 9, 2020
6
2
I've just registered to post a reply here, I have a late 2013 15" MBPr. I've just bought it and I'm having these exact shutdown issues. I also have a non retina 2012 13" which is completely unaffected. Before this 15" I bought a different one with the same specs but sent it back because of these shutdown issues.

So why is it that 2 different MBP's from eBay are having the same issue? Well... could it be something problematic with my icloud account? I've reinstalled OSx and haven't signed into my account yet and the laptop has been stood for half an hour without a shutdown yet, whereas if I sign into my icloud, I'm lucky to get 3 or 4 minutes max. I can't even open terminal and type in the commands in time to try the next fix.

I was going to order a cheap 256gb ssd from amazing to see if DJ was right and it could be linked to the original ssd's going wrong but now I'm thinking it could be an icloud issue. Can anyone else test this? Is anyone willing to do a clean install and not sign in and see how things go?

I can't even boot into recovery using cmd -r as it shutdowns mid boot. I can, however, use internet recovery, which is how I did a clean install. This is a real brain teaser for me and I'm struggling to justify spending out on such an old laptop. Windows may be calling me over to the dark side haha.
[automerge]1594289491[/automerge]
For clarity, I have an Apple SM0512F in my machine. It would be interesting to see if this is a common trait with affected machines.
 

DJSimonR

macrumors newbie
Jan 11, 2018
12
3
I have searched the net to try and find any links to the stock SSD's and random shutdowns but I can't find anything.

It is very strange that I have been having this issue since I bought the machine 2 years ago second hand. I use to just update and then rename the .kext file and I stopped having the issue. I also opened the machine up last year and cleaned it all out but it was stilling having the same issue.

I have now had the new Crucial SSD in the same machine for 2 weeks now, I am running beta Big Sur daily and I updated to beta 2 on Tuesday and I am still having no issues with restarts. I haven't renamed the .kext file on either Big Sur or my Catalina partition and both are running perfectly.

It is very strange indeed.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.