Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable TRIM in OS X 10.7.5 to 10.9.5

Enable TRIM on non-Apple SSDs in OS X

NOTE: This is tested on the versions mentioned in the title, and NOT earlier or later versions. YMMV.

Run the following commands in Terminal…

Backup the original driver:

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

Modify the driver (choose only one of the following lines, based on the version):

# 10.9.4 & 10.9.5
sudo 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' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

# 10.8.3 to 10.9.3
sudo 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' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

# 10.7.5, 10.8.1, 10.8.2
sudo 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' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

Run these commands in succession to clear the system caches to enable OS X to pick up the modified driver:

sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
sudo touch /System/Library/Extensions/

Restart the Mac.

@itavero

This comment has been minimized.

Copy link

commented Nov 19, 2012

Has this been tested on 10.8.2 12C60?

@leolimajr

This comment has been minimized.

Copy link

commented Nov 21, 2012

It is not working on 10.8.2 12B2501 (MacBook Pro 15 Mid 2012 - MacBookPro9,1)

@maiaz

This comment has been minimized.

Copy link

commented Nov 27, 2012

tested on 12C60 - all OK.

@mcnaugha

This comment has been minimized.

Copy link

commented Nov 28, 2012

Looks like Apple's playing cat and mouse with this one. Maybe it's ANOTHER coincidence but this workaround isn't working on the first 10.8.3 prerelease (12D32).

@ivanzoid

This comment has been minimized.

Copy link

commented Nov 28, 2012

Doesn't work on 10.8.2 12C3006 (MacBookPro9,2 = 13" Mid-2012) :(

@mightyoj

This comment has been minimized.

Copy link

commented Jan 12, 2013

got this: Kernel file /mach_kernel does not contain requested arch: i386
after running this: sudo kextcache -system-prelinked-kernel

mid 2012 2.3 mbp 15" 9,1 on 10.8.2[12C60]

"TRIM Support: Yes"

SUCCESS! Thanks!

@deantomasevic

This comment has been minimized.

Copy link

commented Jan 14, 2013

It Works.
Thanks a lot.

@cpierre67

This comment has been minimized.

Copy link

commented Jan 20, 2013

I've tried a similar command line on 10.8.2 but for 10.6 on iMac27 2011. Result: The reboot never ends ... I get the apple logo with the rotating clock ticks, then the apple logo become a round with an oblique bar in it (similar to a disable icon) with a never ending rotating clock ticks. I do I revert back to the original file as I do not get access to finder anymore. Thanks for your help.

@DennisNg

This comment has been minimized.

Copy link

commented Feb 9, 2013

First thanks for the patch for 10.8.2.

I did a backup first then follow yours.

Based on another web site, I add another step after your patch which I am not sure it is important:

  • sudo touch /System/Library/Extensions/

Also, after the command "sudo kextcache -system-prelinked-kernel"

I got some system messages:

/ locked; waiting for lock.
Lock acquired; proceeding.
Kernel file /mach_kernel does not contain requested arch: i386

But ignore it and continue with the "sudo kextcache -system-caches" and reboot; the Apple did report Trim Support.

Hence, may be everything is ok.

@Durchbruch

This comment has been minimized.

Copy link

commented Feb 20, 2013

Thanks a lot! I did not have success using Groths Trim Enabler with 2012 MacBook Pro with Mountain Lion 10.8.2 and a Samsung SSD 840 Pro 512 GB. In addititon I got some system crashes after I tried to activate TRIM using the TRIM Enabler. I never saw this befor (!). TRIM could no be enabled.

Thanks to your lines I had success within the first attempt.

Jochen, Berlin, Germany

@gbdoin

This comment has been minimized.

Copy link

commented Feb 26, 2013

Not working for me on 10.8.2 MacbookPro 13" mid 2012 with Samsung 128 GB 840 pro series. If somebody had the same problem and found a fix, please share :)

Edit: leolimajr's Fork worked for me, thx man! :D

@orion11

This comment has been minimized.

Copy link

commented Mar 3, 2013

Worked for me. 10.8.2 ( 12C60 ) early 2011 Macbook pro 13" , IOAHCIBlockStorage version 2.2.2 , Samsung 256 gb 840 pro. system information shows Trim Support: yes now :) Thanks!

note: did the extra "touch /System/Library/Extensions/" step thats DennisNg mentioned and is in leolimajr's fork, just cuz.

@vgorloff

This comment has been minimized.

Copy link

commented Mar 6, 2013

Thanks! Working for me too. 10.8.2 ( 12C60 ) MacMini Mid 2010 with Crucial M4 (CT128M4SSD1).

@iCrunch

This comment has been minimized.

Copy link

commented Mar 15, 2013

Hey guys! 10.8.3 just dropped (build 12D78). I have an Intel 520 Series 240GB in a Mac mini (6,2) and TIM is, of course, disabled. I was about to try one of the 10.8.2 "hacks", but then I noticed one poster saying "this is only guaranteed on 10.8.2, not before, not after", so I'm holding off for now.

Any news would be highly appreciated!

(Btw, if you don't have TRIM going for a while and then turn it on, will it "undo the damage" that NOT running TRIM until that point caused? Dramatic, I know. But curious. Always curious. ;-) )

Thanks!!!

@skomik

This comment has been minimized.

Copy link

commented Mar 15, 2013

Didn't work for me on MBP 2011, OSX 10.8.3 (12D78). Waiting for update =)

@leolimajr

This comment has been minimized.

Copy link

commented Mar 16, 2013

My fork is still working on OSX 10.8.3 (12D78) take a look at https://gist.github.com/leolimajr/4124375

@clarencesong

This comment has been minimized.

Copy link
Owner Author

commented Apr 23, 2013

Updated the gist with the "sudo touch /System/Library/Extensions/" command.

@xplainit

This comment has been minimized.

Copy link

commented Sep 5, 2014

OSX 10.7.5 build 11G63.
Trim ENABLED. Thanks a lot !!!

@bizulk

This comment has been minimized.

Copy link

commented Nov 3, 2014

MBP With OS X 10.9.5 (13F34)
INTEL SSDSA2M120G2GC 
==> WORKED 😄
THANK YOU !
Question : How did you find out ?

@dwueppel

This comment has been minimized.

Copy link

commented Apr 30, 2015

Worked in MBP with OSC 10.8.5

@OldBaldGit

This comment has been minimized.

Copy link

commented May 12, 2015

MacBook 2.1 2007 upgraded Tiger --> Snow Leopard --> Lion 10.7.5

It worked like a charm first time!

Thank you!!!!!!!!

@Bammonb

This comment has been minimized.

Copy link

commented Jul 21, 2015

Hello All,

Thanks for taking the time to post this information.

Unfortunately I feel that enabling TRIM on my Kingston SSD has slowed it down.

It did enable TRIM successfully.

What is the best course of action to reverse these changes?

I am running MAC OSX 10.9.5

Do I need to go to Genius bar and have them drop a new Image on the HD?

Thanks!

Bill

@fefone

This comment has been minimized.

Copy link

commented Dec 26, 2015

Hi,
successfully enabled TRIM on MacBookPro6,2 - OS X 10.8.5 (12F2560) for a Samsung 850PRO.
Thanks a lot!
fed

@ccastillo

This comment has been minimized.

Copy link

commented Jun 12, 2016

Thank you. This help me with a MacBook late 2007 model running OS X Lion on Patriot Pyro SSD.

Carlos.

@Atalantia

This comment has been minimized.

Copy link

commented Sep 20, 2016

Thank you it works like a charm on a 10.9.5 But if System Information says Trimm is on. Is it really on? How can I see that this is on. And by the way what does it? Randomly change the Memory Location of every bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.