Instantly share code, notes, and snippets.

Embed
What would you like to do?
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks
# And here: http://forums.macrumors.com/showthread.php?t=1410459
# And here: http://forums.macrumors.com/showthread.php?t=1480302
#
# Yosemite: for recovering from stop sign on boot screen, please see http://www.cindori.org/update-on-trim-in-yosemite/
# backup patched file
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.original
# Important: Add "kext-dev-mode=1" as Kernel Arguments or the computer won't boot.
sudo nvram boot-args="kext-dev-mode=1"
sudo shutdown -r now
# looks for "Apple" string in HD kext, changes it to a wildcard match for anything
sudo perl -pi -e 's|\x00\x41\x50\x50\x4c\x45\x20\x53\x53\x44\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
# rebuild kext cache manually (could take a while)
sudo touch /System/Library/Extensions
sudo kextcache -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions
# now reboot!
sudo shutdown -r now
@0ver387

This comment has been minimized.

0ver387 commented Sep 4, 2013

Thank you

@TechFounder

This comment has been minimized.

TechFounder commented Sep 13, 2013

Any idea if 10.8.5 will break TRIM? I'm a bit afraid to update.

@return1

This comment has been minimized.

Owner

return1 commented Sep 13, 2013

it works on 10.8.5, tried it out myself.

@TechFounder

This comment has been minimized.

TechFounder commented Sep 13, 2013

Excellent, thanks!

Is there a reason you omit the two lines which will clear the cache?

sudo kextcache -system-prelinked-kernel

sudo kextcache -system-caches

@N4M3Z

This comment has been minimized.

N4M3Z commented Sep 14, 2013

Confirmed. Works with 10.8.5.

@SnakeO

This comment has been minimized.

SnakeO commented Sep 17, 2013

Thank you. Confirmed working on 10.8.4 with Samsung SSD 840 Series

@ghost

This comment has been minimized.

ghost commented Sep 20, 2013

Thanks a Lot. (Working on 10.8.5 with OCZ Vector)

@veresdaniel

This comment has been minimized.

veresdaniel commented Oct 8, 2013

hi,

thanks for this script. I had success on Mac mini (10.8.5) with it, but seems not working on my hacintosh 10.9GM (OCZ-VERTEX3).

@tboerstad

This comment has been minimized.

tboerstad commented Oct 14, 2013

Hi,

I am also using OCZ-VERTEX3. Suddenly today, after nothing more than a reboot, my mac refused to boot and went to the "no entry" grey screen. I did a verbose boot (alt-command v), and got a repeating error message saying "still waiting for root device".

I traced this error message to "IOAHCIBlockStorage.kext". After running the perl command, and rebooting, my macbook is up and running again. Thanks a lot

@N4M3Z

This comment has been minimized.

N4M3Z commented Oct 22, 2013

Can more people please confirm if this does work on 10.9 GM?

@TechFounder

This comment has been minimized.

TechFounder commented Oct 23, 2013

Anyone tried it on Mavericks (10.9)?

@127-0-0-1

This comment has been minimized.

127-0-0-1 commented Oct 23, 2013

Tried script for Mountain Lion 10.8.3 - 10.8.5 on 10.9
it works!

@return1

This comment has been minimized.

Owner

return1 commented Oct 23, 2013

does work with 10.9

@michaelcoluzzi

This comment has been minimized.

michaelcoluzzi commented Nov 16, 2013

Works with 10.9 with SanDisk UltraPlus 256G aka SanDisk SDSSDH2256G

@duderman

This comment has been minimized.

duderman commented Mar 5, 2014

Works great! Thank you!
10.9.2 md313 KINGSTON SV300S37A120G

@DenimTornado

This comment has been minimized.

DenimTornado commented Mar 25, 2014

10.9.2 OCZ-VECTOR Works, thanks!

@prakdavid

This comment has been minimized.

prakdavid commented Apr 14, 2014

Confirmed. Works on 10.9.2 with Samsung SSD 840 Pro Series

@ghost

This comment has been minimized.

ghost commented Apr 21, 2014

Confirmed works with 10.9.2 with Crucial M550 1TB SSD. :)

@ershovandrey

This comment has been minimized.

ershovandrey commented May 15, 2014

Works with 10.9.3 with Samsung 830 256Gb

@kevan

This comment has been minimized.

kevan commented May 24, 2014

THANKS!!!

Works with 10.9.3 with M4-CT512M4SSD2 512GB

@ghost

This comment has been minimized.

ghost commented Jul 1, 2014

not working anymore with 10.9.4 please provide an update

@return1

This comment has been minimized.

Owner

return1 commented Jul 1, 2014

works for 10.9.4 now

@oak8292

This comment has been minimized.

oak8292 commented Jul 1, 2014

Confirmed for 10.9.4 with a Plextor 256GB M6e. Thanks!!!!

@racsantos

This comment has been minimized.

racsantos commented Jul 2, 2014

Confirmed for 10.9.4, KINGSTON SV300S37A120G Thanks!

@fritztoch

This comment has been minimized.

fritztoch commented Jul 5, 2014

Works for 10.9.4, MacBookPro5,5, OCZ-AGILITY3 (setup as a Fusion drive with a WDC WD10JPVX).

@superlukas

This comment has been minimized.

superlukas commented Jul 10, 2014

Samsung 840 PRO
Confirmed: 10.9.4, 10.9.5, 10.10, 10.10.1, 10.10.2
10.10.3: See @andrewpsy

@DrizzlyOwl

This comment has been minimized.

DrizzlyOwl commented Jul 14, 2014

Confirmed for 10.9.4 KINGSTON SV300S37A240G

@sBaildon

This comment has been minimized.

sBaildon commented Jul 15, 2014

Confirming OS X 10.9.4 Samsung 840 EVO

@ggreco

This comment has been minimized.

ggreco commented Jul 24, 2014

I can add that this works also on 10.10 DP4, the previous version worked until DP2, it seems that 10.9.4 and 10.10 DP3+ share the same SSD driver :)

@markhammond

This comment has been minimized.

markhammond commented Aug 29, 2014

Confirmed working for OS X 10.9.4 PLEXTOR PX-512M6Pro (rev 1.01)

Beware: after 3 days of steady use I encountering random beach balling, culminating in losing the boot sector. I wasn't able to restore the boot partition or repair the disk. Similar reports on the plextor user forum.

@morube

This comment has been minimized.

morube commented Sep 4, 2014

Confirmed for 10.9.4, Samsung 840 EVO

@pderby

This comment has been minimized.

pderby commented Sep 5, 2014

Confirmed for 10.9.5 13F24, Samsung 850 PRO 1TB running on MacMini 3,1

@mklengel

This comment has been minimized.

mklengel commented Sep 18, 2014

Confirmed for 10.9.5 (13F34), Samsung 840 PRO 256 GB on MacPro4,1

@spherique

This comment has been minimized.

spherique commented Sep 19, 2014

Also confirmed for OS X 10.9.5 (13F34), PLEXTOR PX-256M5Pro (rev 1,06) on Macmini6,2

@kassner

This comment has been minimized.

kassner commented Sep 21, 2014

Confirmed for 10.9.5 (13F34), Kingston SV300S37A120G, MacbookPro5,5

@DeathBorn

This comment has been minimized.

DeathBorn commented Sep 23, 2014

Works macbook5.1 (late 2008) with OS X 10.9.5, 8GB RAM, Samsung SSD 840 EVO. Also shows
Link Speed: 3 Gigabit
Negotiated Link Speed: 3 Gigabit
SUPERB!

@sollarman

This comment has been minimized.

sollarman commented Sep 27, 2014

Thank you!

@chrboehm

This comment has been minimized.

chrboehm commented Sep 29, 2014

Confirmed for 10.9.5, Crucial_CT512MX100SSD1, MacBook Pro late 2011

@Mo-Tech

This comment has been minimized.

Mo-Tech commented Sep 30, 2014

Doesn't work with 10.9.5 & 256GB Samsung 850 Pro SSD. Takes all command, gives no error but no TRIM support after reboot. I have SSD connected on MacPro 5,1 (beneth the Superdrive, not into HD socket due to missing adapter). What can be wrong - SATA cable not the same as SATA socket or something about the software?

@leyafo

This comment has been minimized.

leyafo commented Oct 2, 2014

Thanks, you‘re good man。

@metsma

This comment has been minimized.

metsma commented Oct 17, 2014

For Yosemite you have to disable driver signature check
sudo nvram boot-args="kext-dev-mode=1"
http://www.cindori.org/enabling-trim-on-os-x-yosemite/

@TechFounder

This comment has been minimized.

TechFounder commented Oct 17, 2014

This will break Yosemite final release so please don't use it.

Perhaps you need to rebuild kext cache?
# rebuild kext cache sudo kextcache -prelinked-kernel /System/Library/Caches/com.apple.kext.cache/Startup/kernelcache -K /System/Library/Kernels/kernel /System/Library/Extensions

Any idea how to fix now that my computer won't boot correctly?

Update: disk repair won't fix this. I had to reinstall Yosemite from my boot partition.

Someone should try this guy's version to see if that works: https://gist.github.com/rizal72/0f738cc6735744f84bb3

I've already done my good deed for today.

@return1

This comment has been minimized.

Owner

return1 commented Oct 17, 2014

no, it still works. if you get stuck on reboot, please use this instructions, skipping the Trim Enabler Part: http://www.cindori.org/enabling-trim-on-os-x-yosemite/

@return1

This comment has been minimized.

Owner

return1 commented Oct 17, 2014

updated instructions for yosemite to prevent the boot screen lock according to http://www.cindori.org/enabling-trim-on-os-x-yosemite/

@megamosk

This comment has been minimized.

megamosk commented Oct 18, 2014

OSX 10.10
Crucial m4 ct256m4ssd2
TRIM Support: Yes
Thanks!

@ivanke

This comment has been minimized.

ivanke commented Oct 18, 2014

Confirmed for OS X 10.10 ( MacBook Pro 13-inch, 2012 mid )
PLEXTOR PX-128M5S
Trim Support: Yes
Thanks a million

@TechFounder

This comment has been minimized.

TechFounder commented Oct 19, 2014

Thanks, your revised instructions worked with Yosemite.

@HPM41

This comment has been minimized.

HPM41 commented Oct 28, 2014

osx 10.10
mac book mid 2009
all instructions entered
got the message: kext-dev-mode allowing invalid signature -67061 ....
nevertheless: trim seems to work
thanks

@psousa

This comment has been minimized.

psousa commented Oct 30, 2014

Worked for me.
osx 10.10
mac book mid 2010
ocz ssd

Trim works. Thanks!

@maartentromp

This comment has been minimized.

maartentromp commented Nov 5, 2014

Works on my Late 2011 Macbook Pro 13 with 10.10 with Samsung SSD 840 EVO 750GB

@kike1

This comment has been minimized.

kike1 commented Nov 15, 2014

i still get Trim enabler: No after run the script. What happened? i have a KINGSTON SV300S37A120G

@superlukas

This comment has been minimized.

superlukas commented Nov 17, 2014

@kike1 The commands after the first shutdown command are never executed. Somebody should probably change the name of the Gist. Anyway, just copy and paste the commands one by one.

@BrainClot

This comment has been minimized.

BrainClot commented Nov 18, 2014

Thank you! Works on Yosemite 10.10.1

@Haramac

This comment has been minimized.

Haramac commented Nov 18, 2014

Thank you very much! It works perfectly: Crucial M4 (firmware 070H) + Yesomite 10.10.1 :)

@ivanke

This comment has been minimized.

ivanke commented Nov 19, 2014

Confirmed for OS X 10.10.1 ( MacBook Pro 13-inch, 2012 mid )
PLEXTOR PX-128M5S
Trim Support: Yes
Thanks a million

@sman591

This comment has been minimized.

sman591 commented Nov 20, 2014

Doesn't work for me - 2009 MacBook Pro + 120GB SanDisk Extreme...

@pakpenyo

This comment has been minimized.

pakpenyo commented Nov 21, 2014

Work perfectly for 10.10 clean install, then stuck with white circle grey background while update to 10.10.1. But its working after recovering and re enable. (Samsung 840pro 256Gb - MBP 15" early 2011).

@blackgat

This comment has been minimized.

blackgat commented Nov 25, 2014

This worked for me on MacBook (13-inch, Mid 2010) with 240G Intel 530 Series at 10.10.1 clean environment.

@cpBurn

This comment has been minimized.

cpBurn commented Dec 18, 2014

I just did it on OS X Yosemite 10.10.1 on a clean install. Worked like a charm.

@WildPenquin

This comment has been minimized.

WildPenquin commented Dec 20, 2014

Thanks! Seems to work on Yosemite for me on my Kingston V300.

@nobbs

This comment has been minimized.

nobbs commented Dec 22, 2014

Still working with 10.10.2 Public Beta.

@praetor1an

This comment has been minimized.

praetor1an commented Dec 30, 2014

How do I disable TRIM on 10.9 before upgrading to 10.10?

@matbhz

This comment has been minimized.

matbhz commented Dec 31, 2014

Funny, I didn't work on my Yosemite 10.10.1.
Any extra steps you guys above took?

PS: In any case I downloaded Trim Enabler but I am curious to understand why this didn't work.

@zadorozhko

This comment has been minimized.

zadorozhko commented Jan 8, 2015

Confirmed for 10.10.1 and Samsung SSD 850 PRO. Thanks!

@beh

This comment has been minimized.

beh commented Jan 12, 2015

Works like a charm with 10.10.1 and a fusion drive setup with an Intel 330 120GB and a stock 1TB HDD.

@Haramac

This comment has been minimized.

Haramac commented Jan 28, 2015

Works perfect on 10.10.2, but after the update you need to turn it on again.

@sourcerebels

This comment has been minimized.

sourcerebels commented Feb 1, 2015

Thanks. This works perfect on Yosemite with Crucial MX100 256 GB in a 2012 Macbook pro.

@drichardson

This comment has been minimized.

drichardson commented Feb 6, 2015

Worked for me. Samsung 850 EVO 500GB on mid 2012 MacBook Pro with Yosemite 10.10.2 and Samsung EVO 250GB on 2011 MacBook Pro with Yosemite 10.10.2.

I also wrote a tool called TRIMCheck that verifies TRIM is enabled on your SSD drives at each boot and shows a warning message if it is not. This is intended to remind you to rerun the steps in this gist in case an OS X update has updated the kext driver patched by these instructions.

https://github.com/drichardson/TRIMCheck

@tom-san

This comment has been minimized.

tom-san commented Feb 8, 2015

The shell script works well on Mavericks 10.9.5.

An additional tip regarding TRIM using Yosemite:

  • Prepare a Mavericks boot drive using Disk Utility (USB stick / old USB HDD should do)
  • Boot to this drive and modify using the shell script above
  • After rebooting to this drive verify that all 3rd party SSD drives in the system show "TRIM Support: Yes"
    (About this mac -> More Info -> System report -> SATA/SATA Express -> {your SSD drive} )
  • Boot every once in awhile to this drive (e.g. once a week) and run Disk utility choosing "Repair Disk" on your third party SSD.
  • Observe occurrence of prompt message "Trim unused space"

This way you won't have to mess with the kext signing still preventing write amplification.

Please note: That worked for me on a Samsung 840. Maybe some SSD drives fail on the OS's TRIM command. So, please use at your own risk and better yet, make a backup prior to your first attempt.

@mezhaka

This comment has been minimized.

mezhaka commented Feb 9, 2015

It did not work for me with my X25-E Intel SSD drive. (Yosemite 10.10.2, MacBook Pro, Late 2008). I tried it several times but I still get TRIM Support: No in the System Report. The Internets are controversial about why is that: some write that the SLC based SSD drives do not need TRIM, some argue.

@Bialykot

This comment has been minimized.

Bialykot commented Feb 24, 2015

The script works fine on a Yosemite Macbook Pro with Samsung 840 Pro SSD. However, I understand that if I upgrade to a newer revision of Yosemite in the future, the kext signing may be switched on again by the upgrade, which will mean I won't be able to boot the computer (as TRIM is set to on).

I'm very new to all of this so what are the steps for disabling TRIM before any upgrades, please?

@robertcedwards

This comment has been minimized.

robertcedwards commented Feb 27, 2015

Thank you!!!

@managr

This comment has been minimized.

managr commented Feb 27, 2015

This is so cool. Samsung SSD 840 PRO Series says:
TRIM Support: Yes
Thanks!

@GaborTB

This comment has been minimized.

GaborTB commented Mar 3, 2015

If I used the SDD for long without TRIM enabled and apply this script, does OSX zero out all pages that are currently filled up with deleted file data on the SSD retroactively?

@hfoffani

This comment has been minimized.

hfoffani commented Mar 10, 2015

@Bialykot What happens after a kernel upgrade is that Yosemite turns TRIM off. You'll be able to boot but TRIM is deactivated and you need to apply the procedure again. Of course, there's no guarantee here...
I had automatic upgrades switched off and always check this site before upgrading.

@Bialykot

This comment has been minimized.

Bialykot commented Mar 10, 2015

hfoffani - thanks for that. I've just installed the latest security patch to Yosemite 10.10.2 and all went OK and TRIM was still enabled after the update. BUT ... what if there is a more major patch/upgrade to Yosemite - e.g. to 10.11? would I have to disable TRIM before applying the upgrade? And if so, what are the exact steps / script to do this? Sorry if the questions seem a bit naive. Just want to be as sure as I can not to mess up my BBP. (I do have a full backup but this takes several hours).

BTW - the TRIM really works well on my Samsung 840 pro. Without TRIM I was getting 50-100Mb/s write speeds but with it activated I always get around 500Mb/s. :)

@hfoffani

This comment has been minimized.

hfoffani commented Mar 11, 2015

Bialykot. No, you don't need to anything. After upgrading, you'll see that TRIM is unsupported again so you have to apply this patch (or the corresponding one) again. That's why many of us had switched off OS X autoupdates. It's better to check this site before upgrading in case some incompatibilities appears in a future version.

@phmich

This comment has been minimized.

phmich commented Mar 14, 2015

Thank you for that, it works for me

  • Yosemite version 10.10.2 (14C1510) and
  • SSD Kingston SVP100S512G

by the way, I have 2 SSD in my macbook pro 17inch

  • original Apple SSD 128Gb with OSX on it
  • additional SSD 521Gb for data and virtual machines at the place of the superdrive.

I expect that OSX update will not affect the original SSD, but will may be affect the additional SSD
I do not know how it will happens, but I suppose I will be able to patch again the
sudo nvram boot-args="kext-dev-mode=1" and the reboot to get back to my data SSD

@smiera

This comment has been minimized.

smiera commented Mar 18, 2015

Thank you! 10.10.2 and Samsung SSD 840 EVO work great.

@a01fe

This comment has been minimized.

a01fe commented Apr 8, 2015

It doesn't appear to be working after the 10.10.3 update. After running the perl line the driver is unchanged, so it seems that we'll need a new pattern to search for.

@beh

This comment has been minimized.

beh commented Apr 8, 2015

Same result as rbfinch, the perl reg-exp magic does nothing on 10.10.3

@andrewpsy

This comment has been minimized.

andrewpsy commented Apr 8, 2015

replace the perl command with this one worked for me:
sudo perl -pi -e 's|\x00\x41\x50\x50\x4c\x45\x20\x53\x53\x44\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

source http://www.insanelymac.com/forum/topic/298507-enable-trim-on-non-apple-ssd/

@petermolnar-hu

This comment has been minimized.

petermolnar-hu commented Apr 9, 2015

Thanks andrewpsy, you saved my day;). The new perl script line worked for me as well.

@return1

This comment has been minimized.

Owner

return1 commented Apr 9, 2015

updated for 10.10.3, thanks @andrewpsy

@beh

This comment has been minimized.

beh commented Apr 9, 2015

Thanks, worked like a charm

@pvl7

This comment has been minimized.

pvl7 commented Apr 10, 2015

Thank you!
mid-2012 10.10.3 + Samsung Evo 850 500Gb - worked fine!

@nychan

This comment has been minimized.

nychan commented Apr 14, 2015

working great with late 2009 unibody macbook + 10.10.3 + OCZ Agitility 3

@todesto

This comment has been minimized.

todesto commented Apr 17, 2015

Thank you, works great with my 2010 macbook pro + Corsair SSD.
My question is how do you disable before system update?

@francisceril

This comment has been minimized.

francisceril commented Apr 24, 2015

How can I revert back or disable it because I have a new update which fixes graphics for my iMac? Please help.

@highks

This comment has been minimized.

highks commented Apr 27, 2015

Thank you very much, this works very well on a Macpro 2013 with four Samsung 840 EVO in an Akitio Thunder2Quad case (which is a Thunderbolt 2 case with four SATA Slots, the drives are configured as a RAID 1+0 in OSX 10.10.3)
I am very happy this works, because for my setup here, there isn't even any solution by Apple that I could get instead. First they promote the Macpro with all these great, super fast Thunderbolt connections, and then they deactivate TRIM for basically all SSDs connected by Thunderbolt... thanks again, Apple! (sarcastically!)

@ralfbergs

This comment has been minimized.

ralfbergs commented Apr 30, 2015

@francisceril: You don't have to for such a small update. It's not a complete OS update you are mentioning...

@ralfbergs

This comment has been minimized.

ralfbergs commented Apr 30, 2015

This script still works in 10.10.4 public beta (10.10.4 (14E11f)).

@cundi

This comment has been minimized.

cundi commented May 12, 2015

confirmed. It works on 10.10.3
容量: 256.06 GB(256,060,514,304 字节)
型号: PLEXTOR PX-256M6S
修正版: 1.070000
序列号: P02431100565
原生命令队列: 是
队列深度: 32
活动盘片: 否
可拆卸的驱动器: 否
BSD 名称: disk0
介质类型: 固态
TRIM 支持: 是

@ralfbergs

This comment has been minimized.

ralfbergs commented May 16, 2015

This script still works under public beta 10.10.4 (14E17e).

@mashrum

This comment has been minimized.

mashrum commented May 20, 2015

MacBook Pro 6,1 (17' Mid-2010), 10.10.3, Samsung 850 pro 1T = Ok!
Thank you.

@eduardonunesp

This comment has been minimized.

eduardonunesp commented May 20, 2015

MacBook Pro (13-inch, Early 2011), 10.10.3, KINGSTON SV300S37A240G
Works !

@chka

This comment has been minimized.

chka commented May 27, 2015

MacBook Pro (13-inch, Mid 2012), 10.10.3, Samsung SSD 840 EVO 250GB
Works perfectly

@ralfbergs

This comment has been minimized.

ralfbergs commented May 28, 2015

This script still works under public beta 10.10.4 (14E26a).

@herrernst

This comment has been minimized.

herrernst commented May 30, 2015

I wonder if it even is necessary to keep kext-dev-mode enabled? I just booted without it, but still having trim enabled (10.10.3).
screen shot 2015-05-30 at 15 35 16
Of course, if somehow the kernel caches get regenerated, the patched extension will be skipped and you can't boot (you have to repair from recovery partition or USB/DVD as explained here).
By the way: kextcache doesn't directly check the NVRAM value, but the sysctl settings of kern.bootargs (see function isDevMode() at http://www.opensource.apple.com/source/kext_tools/kext_tools-384.1.4/security.c). Unfortunately, the sysctl value is still read-only and can only be set on boot time via NVRAM.

@oniksfly

This comment has been minimized.

oniksfly commented May 30, 2015

Worked for me with OS X 10.10.3 on macbook pro mid 2009, SSD Corsair Neutron.

@khpatel4991

This comment has been minimized.

khpatel4991 commented Jun 5, 2015

How to use this script from windows or MAC?

@herrernst

This comment has been minimized.

herrernst commented Jun 6, 2015

@khpatel4991 You'd have to enter those commands in Mac OS X Terminal (in Applications - Utilities). If this is too complicated for you, you're better off using [https://www.cindori.org/software/trimenabler/](Trim Enabler).

@ralfbergs

This comment has been minimized.

ralfbergs commented Jun 10, 2015

This script still works under public beta 10.10.4 (14E33b)

@highks

This comment has been minimized.

highks commented Jun 16, 2015

I just read the happy news that in OSX El Capitan, there will probably be an official OSX-tool named Trimforce, which enables TRIM for all SSDs if the user chooses to do so. Without having to deactivate the kext-signing, that is!

http://9to5mac.com/2015/06/12/os-x-ssd-trim-support-el-capitan/

I really hope this is true, it would prove that Apple is still able to make sane decisions and listen to their users!

@ralfbergs

This comment has been minimized.

ralfbergs commented Jun 16, 2015

This script still works under public beta10.10.4 (14E36b)

@HofiOne

This comment has been minimized.

HofiOne commented Jun 18, 2015

OCZ-AGILITY3 10.10.3
OK!
thanks!

@ghost

This comment has been minimized.

ghost commented Jun 28, 2015

MacBook Pro (15-inch, Late 2011), 10.10.3, Crucial CT500MX200SSD1
It works! Thanks!

@TechFounder

This comment has been minimized.

TechFounder commented Jun 30, 2015

With the new 10.10.4 trimforce now enabled, do we still need this?

I think it's just a matter of running sudo trimforce enable in your terminal right?

@ralfbergs

This comment has been minimized.

ralfbergs commented Jun 30, 2015

@TechFounder: Confirmed. This patch is no longer required.

@superlukas

This comment has been minimized.

superlukas commented Jul 1, 2015

@TechFounder @ralfbergs This is great news. Thanks for sharing!

BTW: Make sure you undo the changes the script made after updating to 10.10.4. Something like:

sudo rm /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
sudo nvram -d boot-args
# Not sure if these are really necessary
sudo touch /System/Library/Extensions
sudo kextcache -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions
# Reboot and run `sudo trimforce enable`
@gchriswill

This comment has been minimized.

gchriswill commented Jul 1, 2015

sudo trimforce enable

Yesterday, Apple had released OS X 10.10.4, including on it the new remarkable trimforce tool which allow native TRIM support for 3rd parties SSDs. This is a huge win for the Mac users community because the people had ask for this a while ago. I believe that Apple had made this decision because after the release of OS X Yosemite, which includes the new kext signing feature, Mac users were disabling this security feature, which when turned off, allows to execute arbitrary code in modified kext extension natively, WHICH was an huge security flaw. This been said, I guess Apple would rather prefer to allow their Macs to support 3rd parties SSDs and have Macs secured, than have a lot of hacked Macs and all the internet taking about it...

Although, old Macs are getting obsolete due to the absence of current technologies, most of the regular users still can extract a bit more juice of their Macs, so they will find this tool very useful. As for power users, I recommend just buying a new Mac...

@pvl7

This comment has been minimized.

pvl7 commented Jul 2, 2015

"sudo trimforce enable" didn't work for me on 10.10.4. Still had to use the script to change the driver signature and disable security checks :(

@nychan

This comment has been minimized.

nychan commented Jul 12, 2015

I got some issue when disabling the changes done by this script and booted to the STOP sign screen after using sudo trim force enable, one of the crucial thing I missed when disabling the patched driver is I did not remove the patched driver file in "/Volumes/Your Disk Name", seems the guide in the link is good enough for me to fix https://www.cindori.org/trim-enabler-and-yosemite/, though I did mistyped chown/chmod lucky no permanent damage is done anyway, after all the mess I did at least it is working for the TRIM without a patched driver under 10.10.4!

@howtosayhello

This comment has been minimized.

howtosayhello commented Jul 14, 2015

Used this script, even for 10.10.4, always perfect, thanks

@ctismer

This comment has been minimized.

ctismer commented Aug 21, 2015

but it no longer works with 10.10.5 :-(

@drichardson

This comment has been minimized.

drichardson commented Oct 8, 2015

Anyone tried with El Capitan 10.11 yet? I'm getting an Operation not permitted error when trying to make the backup of the driver in the first step.

@return1

This comment has been minimized.

Owner

return1 commented Oct 16, 2015

for 10.10.4 and higher it is just: sudo trimforce enable

@defycgn

This comment has been minimized.

defycgn commented Nov 14, 2015

New Solution worked for me on OS X El Capitan 10.11.2 Beta (15X40a)

@wviana

This comment has been minimized.

wviana commented May 30, 2016

KINGSTON SV300S37A
Confirmed, in my case a 240G (KINGSTON SV300S37A240G)
by: sudo trimforce enable
Mac OS X: 10.11.5

@brianonn

This comment has been minimized.

brianonn commented Dec 19, 2016

PLEXTOR PX-256M6S
confirmed works with 10.9.5 on Early 2008 imac8,1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment