Apple - How do I disable (and re-enable) my Thunderbolt port from the terminal?

Apple has several kexts for the Thunderbolt-Connection :

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

I think the commands you are looking for are either:

sudo kextunload /System/Library/Extensions/AppleThunderboltPCIAdapters.kext
sudo kextload /System/Library/Extensions/AppleThunderboltPCIAdapters.kext

or

sudo kextunload /System/Library/Extensions/IOThunderboltFamily.kext    
sudo kextload /System/Library/Extensions/IOThunderboltFamily.kext

I have a Thunderbolt port in my Mac Pro, but currently no devices. So I can't tell you exactly which kext does the trick.

-- Further Information :

Thunderbolt is basically PCIe tunneled through the DisplayPort Connection. I can imagine that it is based on the ACPIPlatform or IOPCIFamily kernel extension. Either way if you unload those you would probably cut off the branch you're sitting on.

Apple released a document on creating Thunderbolt drivers and how you verify if the device is still online here.

It also says: "In the case of PCI, the I/O PCI family (IOPCIFamily) within the I/O Kit is responsible for enumerating the PCI bridge in the controller chip and any downstream bridges or devices."

Furthermore : "PCI device drivers can determine if a Thunderbolt device is connected by recursively searching over parents in the I/O Registry for the key IOPCITunnelled (...)."

Also have a look into the Developer Library.

Thunderbolt is a complicated technology and you could either write a little program or you can write a launch script that checks and reloads the driver if the device is offline. You could do it manually instead of unplugging it and replugging it in.


The Hackint0sh Community has generously created some kext management tools for everyone to use, even those that own and operate a bone fide, genuine Macintosh.

  • SRTools - (check out the video demo!)

  • Kext Utility

  • Kext Wizard

You can use these tools to experiment and quickly discover exactly what will work for you. SRTools, at least, even has history and undo functions to help you avoid leaving your machine in an unbootable state, which is possible when messing around with OS X extensions. You see... userland is userland, and kernel space is kernel space, and never the twain shall meet, except on the wikipedia page.

The idea here, and what these tools are used for, is to experiment. In the Finder, under the Go menu, select "Go to Folder..." or type ⇪ shift-⌘ command-g and type /System/Library/Extensions in the address field that appears, and in the window that opens, look for extensions with "thunderbolt" in the filename. Use one of the above linked utilities to test your set up with unloading and loading the various kexts, to see which one, if there is indeed one, that will reveal itself as the one you need. Then you can streamline the process later (such as with a very simple bash script that has been appified to unload/reload a kext).

A great resource for discovering how to customize your particular set up is to browse through the Developer Library, and, of course, wikipedia is quite often essential for discovery, and at times, gleaming understanding.