Macbook pro lion系统打开trim支持

非常简单的方法,到 http://www.groths.org/?page_id=322 下载app即可



(下面是老黄历了)

http://www.mactrast.com/2011/07/how-to-enable-trim-support-for-all-ssds-in-os-x-lion/


TRIM can be enabled by using the following Terminal commands.Copy these commands and run them in Terminal:

Backup the file that you’reabout to patch:

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /IOAHCIBlockStorage.original


Patch the file to enableTRIM support:

sudo 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


Clear the kext caches:

sudo kextcache -system-prelinked-kernel

sudo kextcache -system-caches

Important: reboot your Mac!

To disable TRIM support inthe future:

sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00).{9}(\x00\x51)|$1\x41\x50\x50\x4C\x45\x20\x53\x53\x44$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage


Finally, if this does notwork as expected, or if something goes wrong, simply restore the backup:

sudo cp /IOAHCIBlockStorage.original/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

This patch simply edits a file calledIOAHCIBlockStoage, removing a string that makes TRIM work for only Apple SSDs.

你可能感兴趣的:(apple,String,File,perl,Terminal,patch)