DO NOT USE THIS ON OSX 10.10 (YOSEMITE)!!!
Apple enabled TRIM support with OSX Lion (10.7) but there is a catch: apple enabled it only on apple-chosen-SSDs. So if you upgraded your hard drive to a 3rd party manufacturer chances are big that TRIM isn't enabled. Here is how to enable it from commandline:
- open terminal
-
make yourself root
# sudo su -
then change into the needed directory and backup a file
# cd /System/Library/Extensions/IOAHCIFamily.kext
# cd Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS
# cp IOAHCIBlockStorage IOAHCIBlockStorage.backup -
than patch the file for Mavericks 10.9.4-10.9.5
# perl -pi -e 's|(^\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' IOAHCIBlockStorage -
OR for Mountain Lion 10.8.3 – Mavericks 10.9.3
# perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' IOAHCIBlockStorage -
OR for Mountain Lion 10.8.1-10.8.2 and Lion 10.7.5
# perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x4D)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' IOAHCIBlockStorage -
OR for Mountain Lion 10.8.0 and Lion 10.7.4 BELOW
# perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' IOAHCIBlockStorage - # touch /System/Library/Extensions/
- reboot your machine
In the system report (system information > serial-ata device) the TRIM support should list YES. The patch has to be re-applied everytime there's an OS update.