MacBook – How to disable (and re-enable) the Thunderbolt port from the terminal

macbook proterminalthunderbolt

I've been having this problem with my Matrox DualHead2Go ME and my late 2011 15" MBP (running 10.9.2). When the displays wake from sleep, the external monitor does not re-awake.

I've gathered that this is because the Matrox unit goes into its own sleep mode and is not re-awoken by the OS's wake signal.

What does work is unplugging and plugging back in the thunderbolt cable my Matrox is connected with. This is less than ideal, however, as I worry about wear and tear from plugging/unplugging the cable multiple times a day.

Is there any way I could toggle my thunderbolt drive on and off from the terminal to avoid the constant plugging/unplugging of the thunderbolt cable?

Best Answer

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.

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.