Jump to content
scrax

Activate TRIM support on any SSD

55 posts in this topic

Recommended Posts

http://www.groths.org/?p=308

to download TRIM Enabler

trimscreen.png

 

or use this kext:

IOAHCIFamily.kext.zip

 

Before:

post-464373-1301165210_thumb.png

After:

post-464373-1301165223_thumb.png

 

And for the terminal fans (like me):

sudo perl -pi -e 's|\x41\x50\x50\x4C\x45\x20\x53\x53\x44|\x00\x00\x00\x00\x00\x00\x00\x00\x00|g' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

 

Note: TRIMEnabler will install a 2.0.5 IOAHCIFamily.kext like the one in the .zip that has INSIDE a binpatched IOAHCIBlockStorage.kext to enable TRIM support on any SSD not only on APPLE SSD.

The terminal command will be useful only if your system has in /S*/L*/E* a 2.0.5 IOAHCIFamily.kext installed so it will become useful only for future Osx updates (10.6.8 or 10.7)

Share this post


Link to post
Share on other sites
Advertisement

I believe this is working - my xbench stores have steadily improved today (Kingston G2) thanks!

Share this post


Link to post
Share on other sites
it should work on any SL version, but don't take it as a fact until it's been done :D

Hi Cindori, I wasn't aware you where registered here. Nice to know it. And thank's for your TRIMEnabler.

Share this post


Link to post
Share on other sites
Thanks, works on a 10.6.7 without problems. How can I test really work?

you need to check how deleted file are handled using linux, here someone already did it:

 

Reader Notes/Tricks for 3rd party SSD OS X TRIM Support

(From a reader mail yesterday. I've not kept up with this subject for some time...)

"Subject: Third-Party TRIM SSD Support in Mac OS X

Hello Mike. I have good news for those people still waiting for support of TRIM command for third-party Solid State Drives (in OS X). Now we have a support!

 

 

It was tested with Intel SSD 2nd generation and OCZ Vertex and it is fully working. But for launch to work we need an IOAHCIFamily.kext (Kernel Extension) with Plugin inside called IOAHCIBlockStorage.kext where in the directory you can find a binary with the same name. This can be downloaded now from internet. This kernel extension was taken from Mac OS X 10.6.6 (10J3210) that came with MacBook Pro 2011. (not the std OS X build)

 

Open it with HEX editor and search for "APPLE SSD". This is verification on "if this Solid State Drive is an Apple or not?" implemented by Apple. Simply change this 9 symbols with first 9 symbols from name of your SSD.

(FYI - per Viktor's later mail (see below), replacing Apple SSD with all Hex zeroes is another/better option)

Install this modified kext with kexthelper (don't forget to rebuild cache with button in kexthelper) and reboot.

Voila!

This is works on latest Mac OS X 10.6.7 and 10.7 Developer Preview.

-Viktor D.

 

I asked about any proof that trim is really working in OS X, not just the OS reporting it as supported. (Many SSDs have GC support in firmware, which has been a plus for OS X users w/o Trim support.)

Here's his reply regarding proof of trim working.

Ok, there are three things:

 

1) Apple can do it (just show "yes") through detecting media type of Disk in System Profiler (which is more simple) instead of using for this AHCI driver. And another thing - this is all SSDs, just with different names, which all supports unified commands.

 

2) IOAHCIBlockStorage.kext is not something simple. This driver (Input Output Advanced Host Controller Interface Block Storage) manages all IO for SATA Storage Devices, ie. NCQ, R/W operations, TRIM, etc.. How OS checks that TRIM is supported and works in drive? As you can see in my last message - we tested a group of disks, the ones which support TRIM natively and those which produced early that lacked TRIM support. Those disk that supported it, OS recognized. Those which lacked it OS shows "TRIM Support: No" without exception. To check - IOAHCI after detecting that this is not "rotational" disk (reports no spinning speed), it sends the TRIM commands "BuildATATrimCommand" (found inside IOAHCIBlockStoorage) to the SSD. If SSD executes this, on specific address of clusters after trimming will be zeroes like if we had a secure format with zeroes, then IOAHCI reports that command executed, and SSD supports TRIMming. If the command was ignored and not executed, OS reports that this SSD doesn't support TRIM. This command is not a process which can be monitored by Activity Monitor. It is just a command to SSD's controller which will do this work fully automatically without OS intrusion. This is the algorithm to understand "how os checks that TRIM is supported and executed".

 

3) Another proof. First what we noted is reverting performance via synthetic test back to original. Another - is using "hdparm" method. Booted in linux, mount SSD with HFS, creates small file in specific place and saves the info about address of sectors that contains that file. In linux TRIM is turned off for HFS. Boot to OS X and delete this file. Back to linux - check the address - and we see only zeros. TRIM is working.

(In theory any SSD that supports TRIM should work but he later wrote with results of more testing)

Some more information about activated TRIM tests with other SSDs. These models tested and TRIM verified working:

 

Kingston V+ SSDNow Series

Intel X25-S/M 2nd Gen Series

Western Digital Silicon Edge Blue Series

OCZ Agility 2 Series

OCZ Vertex Series

-Viktor D."

 

Thanks to Viktor for taking the time to send this. (Another reader replied he also used Viktor's tip successfully. He used file from a new 2011 MacBook Pro's 10.6.7 (10J3250). Does not work with the standard build of 10.6.7 (10J869) nor std 10.6.6 builds, as Viktor noted above he used 2011 MacBook Pro 10.6.6 file.)

 

Update: from Viktor Saturday afternoon:

 

" Hi again! Important update to mod info about enabling trim.

Instead of writing the name of desired SSD in IOAHCIBlockStorage binary, we can rewrite in hexadecimal table string APPLE SSD with (Hex) zeroes. In right (Hex) table where letters will be displayed as dots. What benefit of this? (vs SSD name) - This will work with any SSD Drive that supports TRIM. And not only for one model, even with different models/different mfrs/brands. Universal solution (for TRIM supporting SSDs) to this problem in other words.

-Viktor D."

I suspect someone will post an already edited file for download.

(Update - a MR forum member created a utility to do the patching - not tried it personally but the D/L is http://groths.org/zeus/TRIMEnabler.zip)

source: http://www.xlr8yourmac.com/index.html

(It's the article in the home at the moment but I can't find a direct link. Probably in future it will be difficult to find out so I quoted all the article here, just in case.)

 

 

I'll try to keep here a list of tested ssd so please contribute with your experience, posting sistem version and ssd type.

 

for now we have:

 

Crucial M225

Kingston V+ SSDNow Series

Intel X25-S/M 2nd Gen Series

INTEL SSD G2

Intel 510 SSD

INTEL SSDSA2M160G2GC

Western Digital Silicon Edge Blue Series

OCZ Agility 2 Series

OCZ Vertex Series

OCZ Vertex 2 Series

G-SKILL Falcon

OWC Mercury Extreme Pro SSD

OWC Mercury Aura Pro SSD

Share this post


Link to post
Share on other sites
;)

that's more easy than OxED ;)

 

;)

Yes of course , ----------------- errata corrige

 

:)

Fantastic Result on my two SSD vertex 2 in raid 0

Tested on 10.6.6

Hey man sorry for my bad english

post-410253-1301230780_thumb.png

Share this post


Link to post
Share on other sites
:P:P

I have tried on two SSD vertex 2, but without the kext that you have in down, I have only replaced this.

The one you replaced is INSIDE the one I've posted.

I posted all the bundle because it is more easy to install.

Share this post


Link to post
Share on other sites
The one you replaced is INSIDE the one I've posted.

I posted all the bundle because it is more easy to install.

 

ok, ok , now they are happy, for me the trim works well, but I must make the tests between a month in order to see if forgiveness in reading or writing

 

omini12.gif

omini12.gif

 

Great news scrax :P

It works also in SL 10.6.5?

 

No..sorry

 

it should work on any SL version, but don't take it as a fact until it's been done :P

 

omini12.gif

 

Thank s

Share this post


Link to post
Share on other sites
I think I've to install SL 10.6.6 and his AppStore :P

Have you tried on 10.6.5 so? what didn't work?

Share this post


Link to post
Share on other sites
I didn't test yet because I don't have my hack at the moment.

magnifico says that don't work on SL 10.6.5 (Post #15) :unsure:

 

The kext posted is like a driver with support for TRIM so it will not work only if there is something else that break it. I think that on 10.6.5 it could work. If I can I'll try it on 10.6.4 but before I have a lot of other works to do.

 

P.S.:

I belive that Magnifico sad that because of the subtitle of this topic, for what I know he doesn't have a 10.6.5 build to test it.

Share this post


Link to post
Share on other sites
The kext posted is like a driver with support for TRIM so it will not work only if there is something else that break it. I think that on 10.6.5 it could work. If I can I'll try it on 10.6.4 but before I have a lot of other works to do.

 

P.S.:

I belive that Magnifico sad that because of the subtitle of this topic, for what I know he doesn't have a 10.6.5 build to test it.

 

I have installed the 10.6.5 on the clone, does not work , but because you have fear of Apple store?

 

:unsure::)

Share this post


Link to post
Share on other sites

This is great, too bad I don't have an SSD :/. I have one in an old mac running leopard, wish I could use it on that.

Share this post


Link to post
Share on other sites

Installation went well. Xbench scores before and after;

 

BEFORE PATCH

 

System Info

Xbench Version 1.3

System Version 10.6.7 (10J869)

Physical RAM 4096 MB

Model iMac8,1

Drive Type OCZ-VERTEX2 3.5

Disk Test 351.36

Sequential 212.97

Uncached Write 274.16 168.33 MB/sec [4K blocks]

Uncached Write 291.89 165.15 MB/sec [256K blocks]

Uncached Read 108.13 31.64 MB/sec [4K blocks]

Uncached Read 406.43 204.27 MB/sec [256K blocks]

Random 1003.40

Uncached Write 1290.74 136.64 MB/sec [4K blocks]

Uncached Write 505.85 161.94 MB/sec [256K blocks]

Uncached Read 3328.23 23.58 MB/sec [4K blocks]

Uncached Read 1070.26 198.59 MB/sec [256K blocks]

 

AFTER PATCH

 

System Info

Xbench Version 1.3

System Version 10.6.7 (10J869)

Physical RAM 4096 MB

Model iMac8,1

Drive Type OCZ-VERTEX2 3.5

Disk Test 345.48

Sequential 207.31

Uncached Write 271.01 166.40 MB/sec [4K blocks]

Uncached Write 275.40 155.82 MB/sec [256K blocks]

Uncached Read 109.20 31.96 MB/sec [4K blocks]

Uncached Read 355.02 178.43 MB/sec [256K blocks]

Random 1035.90

Uncached Write 1376.90 145.76 MB/sec [4K blocks]

Uncached Write 525.05 168.09 MB/sec [256K blocks]

Uncached Read 3360.08 23.81 MB/sec [4K blocks]

Uncached Read 1071.93 198.91 MB/sec [256K blocks]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×