Skip to content

Instantly share code, notes, and snippets.

@raulmoyareyes
Forked from return1/trim_enabler.txt
Last active May 17, 2016 20:31
Show Gist options
  • Save raulmoyareyes/95ccf1ffa2e594add191 to your computer and use it in GitHub Desktop.
Save raulmoyareyes/95ccf1ffa2e594add191 to your computer and use it in GitHub Desktop.
# For Mac OS X El Capitan
sudo trimforce enable
# For Mac OS X Yosemite
# backup patched file
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
# Important: Add "kext-dev-mode=1" as Kernel Arguments or the computer won't boot.
sudo nvram boot-args="kext-dev-mode=1"
sudo shutdown -r now
# looks for "Apple" string in HD kext, changes it to a wildcard match for anything
sudo perl -pi -e 's|\x00\x41\x50\x50\x4c\x45\x20\x53\x53\x44\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
# rebuild kext cache manually (could take a while)
sudo touch /System/Library/Extensions
sudo kextcache -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions
# now reboot!
sudo shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment