Enable Trim Support on Mac OS X and macOS
With the introduction of solid state drives (SSDs), Apple began enabling TRIM support only on its OEM supplied drives to ensure a predictable compatibility with the TRIM protocol as some 3rd party drives weren’t fully supported.
To manually override and enable this feature on a new SSD supporting a proper implementation of TRIM, the following shell commands will do the trick. Patching the kernel extension (kext) responsible is unique to your version of OS X (or macOS). The patching process involves the blanking out of the harddrive whitelist allowing the OS to utilise the TRIM feature on all supporting drives. Third party enabling software does exist.
Patching OS X 10.6.8
To patch the kext for TRIM support in Mac OS X Snow Leopard 10.6.8, fire up a terminal window and enter the following:
Begin by backing up the original kext driver to your home directory
Then search for and replace the segment of code responsible for limiting TRIM support to Apple OEM devices only.
The following code is specific to 10.6.8 only!
After patching, purge all kext caches in OS X with the following commands
The last step is restarting your mac. You can do so manually or, if you still have the terminal window open, enter the following:
In case you no longer wish to have this enabled, simply restore the original kext file you saved in the first step:
It took some trial and error to assemble this guide as most resources I’ve found were either incorrect or were for other macOS/OS X versions.
For other OS X or macOS versions
10.7.5, 10.8.1, 10.8.2
Exchange the search and replace string above in the second command with the following
10.8.3 to 10.9.3
Exchange the search and replace string above in the second command with the following
10.9.4 & 10.9.5
Exchange the search and replace string above in the second command with the following
Newer macOS laptops can benefit from the latest version of Oskar Groth’s Trim Enabler 4 app. Although I’ve never used it, it will probably save you the headache of being on top of the latest updates/ changes to macOS.
References
Resources and references used include a gist by clarencesong on GitHub, a MacTrast post on the 2011 Trim Support Enabler 1.1 third party tool by Oskar Groth and a functional 10.6.8 patch code by MacKonsti.
Material on this site is licensed under a Creative Commons BY-NC-SA 4.0 license unless specified otherwise.