This repository has been archived by the owner. It is now read-only.
Enable TRIM on Mac OS X for non-Apple SSDs
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

TRIM patcher

This project is made obsolete by El Capitan, which enables TRIM for third party SSDs out of the box. See man trimforce.

Based on Grant Pannell information about how to patch Lion properly to enable TRIM support on non-Apple branded SSDs, here's a script that ought to make it harder to shoot yourself in the foot.

Important note about Yosemite

Yosemite now signs kexts and refuses to load unsigned ones. This means a patched version won't load, hence your Mac won't boot. If you still want to use TRIM patcher on Yosemite, you can use the following command to allow unsigned kexts to load:

nvram boot-args=kext-dev-mode=1

This comes at a price though, as you're lowering one level of defense in your system security.


I took most steps I could to ensure kitten safety, but can make no warranty.In any case you're on your own. This is ultimately a sensitive hack and you take full responsibility by running this script.

I have tested this successfully on a MacBook Pro 5,5 with Mac OS X 10.7.1 upgraded from 10.7 and a SATA-II Samsung 470 Series 128G in the HD slot. The patched file is the same as in 10.7. I later tested it on 10.7.2.


Simply start up a terminal and run the script:


As the kext cache gets cleared upon success you might find it seems to take some time to complete.

Once the script ends, reboot.

You can then check if it was taken into account via the System Profiler: go to Serial-ATA and look for "TRIM support: yes".

It is debated whether Sandforce-based SSDs (or other recent auto-GC SSDs) actually need this, both performance-wise and wear-wise.

Available arguments

Run with no arguments to see a quick reminder. Here's something more extensive about what's actually done:

apply       applies the patch, after making sure we know the
            file we're applying to, backing it up only if it's
            the original one, and subsequently checking if the
            patch applied correctly.
restore     restores from the previously made backup.
status      shows current situation, including status of the file
            and whether a backup is available.

In any case of changing success, the kext cache gets cleared.