Created
September 30, 2011 15:14
-
-
Save cfeduke/1254049 to your computer and use it in GitHub Desktop.
Enable TRIM on OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# derived from http://www.mactrast.com/2011/07/how-to-enable-trim-support-for-all-ssds-in-os-x-lion/ | |
# requires that you run with sudo | |
cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /IOAHCIBlockStorage.original | |
perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00).{9}(\x00\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' \ | |
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage | |
sudo kextcache -system-prelinked-kernel | |
sudo kextcache -system-caches | |
echo "Reboot to complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment