OSX Updates vs Unsupported SSD vs Trim

About a year ago I’ve upgraded harddrive in my MacBook to SSD. This is one hell of an upgrade and you can belive it or not it’s one of the most important ones you should perform.

This upgrade is not so pain less as it looks like and after every system upgrade (Security Upgrades, Version updates, etc) you should check if Trim is enabled and active.

I useĀ Trim Enabler. It has a easy to use GUI interface which tells you if it’s activeImage

But when you can’t or don’t want to install any software you can perform 4 commands that do the magic.

Before proceeding further down the spiral (;-)) we need to do backup of the file. It can be helpfull if something will go wrong:

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

Patch the file to enable TRIM 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

And finally reboot your system
OSX Updates vs Unsupported SSD vs Trim