MacBroke Pro

One of the responsibilities of being an “IT Professional” is supplying computer fixes for friends, employees, friends of employees, etcetera.

Today’s example is a 2011 15″ MacBook Pro belonging to the daughter of a friend of the CFO, and the symptom is “won’t boot and contains all of the stuff she needs for a college paper”.

Normally I would just mount the laptop as an external drive and copy whatever is needed to my laptop in order to zip it up and hand it over – but in this case they weren’t sure what data was needed, where it was, or what program it might be locked into. So the better option is to get them back into the machine by either fixing it or transposing the HD to a similar laptop.

Booting the laptop results in a hang at about three quarters of the process with the occasional band of GPU noise on the screen.

It looks like a failed GPU, but we need to determine this is the case. So we boot the machine into single-user with CMD-S a the boot chime to get the boot process text scroll and, yep, it hangs after initializing en2 – which is where the OS initializes the external GPU.

Okay, time for some pointy-hat wizardry…

Macs are basically *nix machines with a candy-coated user interface, so we can use this single-user text environment to tell the laptop to never use the external GPU and instead use the CPU graphics exclusively.

This is done by setting a parameter in the nvram… The format for this is nvram <UUID>:<EFI var name>=<value> – so…

nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00

This will allow the laptop to boot into the graphical recovery mode (CMD-R) so that we can proceed…

See, Macs defend themselves from even well-intentioned poking and prodding of the core parts of the OS, and being as we need to now stop the OS from loading the kexts (drivers in Mac-Speak) for the now disabled video card, we need to turn that off.

Once we’re in recovery mode, we can open the terminal and disable System Integrity Protection (SIP) with:

csrutil disable

Now we need to reboot back into single-user mode (CMD-S), because we need run a few more text commands to keep the system from getting confused…

sbin/mount -uw

This mounts the HD with read/write permissions, which we will use to move the discrete GPU drivers into a different directory where they won’t get loaded (but you can put them back if needed). So let’s make a new directory for the files…

mkdir -p /System/Library/Extensions-off

Now to move them…

mv /System/Library/Extenstions/AMDRadeonX3000.kext /System/Library/Extensions-off/

And lastly we need to touch the extensions directory to tell the OS that something changed…

touch /System/Library/Extensions/

After one more reboot the laptop is now working well enough for the user to back up their stuff and finish the paper.

And another happy customer…

Listening to "The Future's So Bright, I Gotta Wear Shades" by Timbuk 3