IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to activate TRIM on any SSD, 25/03/2011 - Your reactions
Options
machmeter
post Mar 25 2011, 10:28 AM
Post #1


Belgian Foundry
*****

Group: Moderators
Posts: 1,622
Joined: 31-March 10
From: Belgium, France, USA, Netherlands
Member No.: 12,632



It is now done! we were able to activate the TRIM command on an OCZ-Vertex SSD! First, thanks to armdn, a member of our forum for telling us about the solution found by German and/or Russian Mac users. He was able to activate TRIM on his Intel SSD:



Two things to start with:
— You will need an hex editor, you can find some easily for free. We used 0XED that we recommend, but there is also HexEdit and many others.
— Then you need to read the news about the activation of TRIM on an APPLE SSD, because the procedure is the same, the addition here is the modification of the extension.

You will need to modify the extension identifying the disk and thus allowing TRIM or not: IOAHCIFamily.kext version 2.05.
If you don't have a 2011 MacBook Pro, you will have to download that version of the extension following the link in the news about the APPLE SSD. If you have a 2011 MacBook Pro, you can use the one you find in the extension folder, after checking that it is indeed version 2.05.
The owner of the extension folder is the root user, so you cannot edit the extension if you leave it in that folder. The easiest is to copy it in two different folders on the desktop one "original" to keep one extension as a backup in case you have a problem, and one "modified". A simple click and drop will copy the extension.
Extensions are usually drivers allowing the system to work with the components connected or integrated to the computer. They can be quite complex.
Right click on IOAHCIFamily.kext and choose "Show package contents" you will find a plug-in folder in which there are two files, also extensions: IOAHCIBlockStorage.kext and IOAHCISerialATAPI.kext.
You can now access the file you have to modify: IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.
To do so, do a right click again, on IOAHCIBlockStorage.kext and choose again "Show package contents" and follow the path until you reach "MacOS". Keep that window open.
Launch your hex editor, click on File/Open and drop in the window that opens then the binary file IOAHCIBlockStorage. The main window of the software will open. Search for the following characters: "APPLE SSD", be careful to include the upper case in the search. You will find two results.




You have to replace "APPLE SSD" by the name of your disk. You need the same number of characters (9), including spaces if there are some. The easiest way is to copy the first 9 character as they are displayed in System Profiler and to paste it in the right column in the hex editor. For example, you can see on the pictures that "OCZ-VERTE", the name of our SSD, has replaced "APPLE SSD". Do the same for the second result. Quit the editor and don't forget to save of course.





From that point on, you just need to follow the directions explained in the other news about APPLE SSD. To make it short, you will have to replace the original extension by the modified one in the extension folder, but you have to do it right, follow the indications precisely.
If you have a problem during your first reboot with a stop sign (circle crossed), force the computer off, restart it while pressing shift, and it will boot without the extensions. Reboot again, it should solve the problem.
Here is the result we got:





Just a few more things to conclude:
Before trying to activate TRIM, make sure that your SSD supports it. The first models, even the ones that Apple shipped in 2008 do not support it.
TRIM is a command that was implemented very recently in Mac OS X, so it is still hard to tell whether is really makes a difference. Theoretically, this command prevents the disk from decreasing in performances while it is filling-up.
Also, we can only see that TRIM is marked as active in System Profiler, but we don't have any proof that would allow us to say for sure that it is really active.
In the next few weeks, we will keep looking into and we will keep you updated on what we find.

By Machmeter, original by Guy
Go to the top of the page
 
+Quote Post
armdn
post Mar 25 2011, 11:28 AM
Post #2


Green Apple


Group: Members
Posts: 9
Joined: 24-March 11
From: St. Petersburg, Russian Federation
Member No.: 14,242



I think we can now say that it works, not just "yes" in Profiler. The System Profiler get this Yes after the verification and command "BuildATATrimCommand" passed through without ignoring by SSD. If the command ignored, then system will understand that this SSD doesn't support TRIM (even if this SSD added to IOAHCIBlockStorage) and will report that TRIM Support: No to the Profiler.

This post has been edited by armdn: Mar 25 2011, 11:30 AM
Go to the top of the page
 
+Quote Post
liudger
post Mar 25 2011, 12:30 PM
Post #3


Green Apple


Group: Members
Posts: 6
Joined: 23-March 11
Member No.: 14,237



QUOTE (armdn @ Mar 25 2011, 11:28 AM) *
I think we can now say that it works, not just "yes" in Profiler. The System Profiler get this Yes after the verification and command "BuildATATrimCommand" passed through without ignoring by SSD. If the command ignored, then system will understand that this SSD doesn't support TRIM (even if this SSD added to IOAHCIBlockStorage) and will report that TRIM Support: No to the Profiler.


How does trim work exactly? If a drive haven't been doing trim actions for a year and you activate it. Will it start cleaning the whole drive? Or only the parts where is writing en moving files?
Go to the top of the page
 
+Quote Post
armdn
post Mar 25 2011, 12:43 PM
Post #4


Green Apple


Group: Members
Posts: 9
Joined: 24-March 11
From: St. Petersburg, Russian Federation
Member No.: 14,242



There is no matter when it is activated, right out of the box, or year later. It will clean sections that needs to move.
Go to the top of the page
 
+Quote Post
syb
post Mar 25 2011, 01:43 PM
Post #5


Green Apple


Group: Members
Posts: 2
Joined: 24-March 11
Member No.: 14,243



Hi.
It seems that my July 2009 MBP (APPLE SSD TS256A) does not support TRIM.
Is there software that one could run once in a while to perform similar cleanup to what TRIM does?
Thank you.
Go to the top of the page
 
+Quote Post
hamishb
post Mar 25 2011, 11:40 PM
Post #6


Green Apple


Group: Members
Posts: 2
Joined: 25-March 11
Member No.: 14,248



Did as said. Now won't reboot - I get the X mark

Tried rebooting with shift held down. Same thing.

I couldn't change owner to system as not an option. Any ideas?

Please help! sad.gif
Go to the top of the page
 
+Quote Post
hamishb
post Mar 26 2011, 04:46 AM
Post #7


Green Apple


Group: Members
Posts: 2
Joined: 25-March 11
Member No.: 14,248



QUOTE (hamishb @ Mar 26 2011, 08:40 AM) *
Did as said. Now won't reboot - I get the X mark

Tried rebooting with shift held down. Same thing.

I couldn't change owner to system as not an option. Any ideas?

Please help! sad.gif


Thankfully I had made a backup and was able to put MBP into Firewire target disk mode connected to the iMac (I had a FW800 cable too luckily).

Moved old extension back and then shut down MBP and disconnected FW cable.

Rebooted and voila - working again. Thanks Apple for making such ingenious this as FW disk mode. tongue.gif
Go to the top of the page
 
+Quote Post
armdn
post Mar 26 2011, 04:54 AM
Post #8


Green Apple


Group: Members
Posts: 9
Joined: 24-March 11
From: St. Petersburg, Russian Federation
Member No.: 14,242



QUOTE (hamishb @ Mar 26 2011, 05:46 AM) *
QUOTE (hamishb @ Mar 26 2011, 08:40 AM) *
Did as said. Now won't reboot - I get the X mark

Tried rebooting with shift held down. Same thing.

I couldn't change owner to system as not an option. Any ideas?

Please help! sad.gif


Thankfully I had made a backup and was able to put MBP into Firewire target disk mode connected to the iMac (I had a FW800 cable too luckily).

Moved old extension back and then shut down MBP and disconnected FW cable.

Rebooted and voila - working again. Thanks Apple for making such ingenious this as FW disk mode. tongue.gif


Install kext with kexthelper, and also DON'T FORGET TO REBUILD EXTENSIONS CACHE! smile.gif
Go to the top of the page
 
+Quote Post
markbailey747
post Mar 26 2011, 05:36 AM
Post #9


Green Apple


Group: Members
Posts: 3
Joined: 20-April 09
Member No.: 11,846



rolleyes.gif Just wanted to chime in with a report of success. I have a 2010 MBP i5 with an Intel X-25M 160GB SSD and I did experience the issue with the boot problem icon replacing the Apple in the middle of the screen and failure to boot. But after rebooting with the shift key depressed "safe boot" everything is working fine. Thanks for the hack notes and link to download the 2.0.5 extension.
Go to the top of the page
 
+Quote Post
armdn
post Mar 26 2011, 09:12 AM
Post #10


Green Apple


Group: Members
Posts: 9
Joined: 24-March 11
From: St. Petersburg, Russian Federation
Member No.: 14,242



QUOTE (markbailey747 @ Mar 26 2011, 06:36 AM) *
rolleyes.gif Just wanted to chime in with a report of success. I have a 2010 MBP i5 with an Intel X-25M 160GB SSD and I did experience the issue with the boot problem icon replacing the Apple in the middle of the screen and failure to boot. But after rebooting with the shift key depressed "safe boot" everything is working fine. Thanks for the hack notes and link to download the 2.0.5 extension.


again, I say "Don't forget to rebuild extensions cache!" with proper command from terminal: "sudo touch /System/Library/Extensions/"
Go to the top of the page
 
+Quote Post
bugmenotplease
post Mar 26 2011, 11:30 AM
Post #11


Green Apple


Group: Members
Posts: 6
Joined: 12-May 09
Member No.: 11,869



Confirmed working with my Vertex 2. Thank you so much!
Go to the top of the page
 
+Quote Post
ledt
post Mar 26 2011, 12:34 PM
Post #12


Green Apple


Group: Members
Posts: 2
Joined: 26-March 11
Member No.: 14,250



not-working on a Mac Pro 2006 with Intel X-25M G2 (postville-with TRIM support): Trim Support shows: NO

This post has been edited by ledt: Mar 26 2011, 12:52 PM
Go to the top of the page
 
+Quote Post
armdn
post Mar 26 2011, 04:44 PM
Post #13


Green Apple


Group: Members
Posts: 9
Joined: 24-March 11
From: St. Petersburg, Russian Federation
Member No.: 14,242



QUOTE (ledt @ Mar 26 2011, 12:34 PM) *
not-working on a Mac Pro 2006 with Intel X-25M G2 (postville-with TRIM support): Trim Support shows: NO


It confirmed to work, see what you doing wrong. In IOAHCIBlockStorage there is a Two Strings "APPLE SSD" which must be edited.
Go to the top of the page
 
+Quote Post
ledt
post Mar 26 2011, 05:16 PM
Post #14


Green Apple


Group: Members
Posts: 2
Joined: 26-March 11
Member No.: 14,250



works now with the patched extension ( Mac Pro 2006 with Intel X-25M G2 Firmware 2CV102H)
Go to the top of the page
 
+Quote Post
bogey
post Mar 27 2011, 11:15 PM
Post #15


Green Apple


Group: Members
Posts: 8
Joined: 27-March 11
Member No.: 14,256



I can also confirm this works with my Corsair F120 on MacBook Pro 13" (early 2011)

I also validated the HDD sectors were zeroed after trashed a file.

Here's good instructions for Ubuntu to check trim is working, I think same is valid for Mac OS X.
http://askubuntu.com/questions/18903/how-to-enable-trim

I don't know how to check the sectors in Mac OS X so I used Ubuntu live cd and hdparm to check them.

1. Boot to OS X and create a tempfile to home dir
sudo dd if=/dev/urandom of=tempfile count=100 bs=128k

2. Load Ubuntu live cd, when in install screen press ctrl-f2 to go to console

3. Mount OS X disk
sudo mkdir /tmp/macosx
sudo mount /dev/sda2 /tmp/macosx

4. check the start sector of the tempfile
sudo hdparm --fibmap /tmp/macosx/Users/username/tempfile
copy the number under "begin_LBA" and use it in the next command

5. read the sector
sudo hdparm --read-sector 72276768 /dev/sda

it lists a page of hex code

6. Reboot to OS X and use finder to trash the tempfile and empty trash

7. boot back to Ubuntu live cd, when in install screen press ctrl-f2

8. read the sector again
sudo hdparm --read-sector 72276768 /dev/sda

now it displays zeros

This post has been edited by bogey: Mar 27 2011, 11:24 PM
Go to the top of the page
 
+Quote Post
armdn
post Mar 28 2011, 05:47 PM
Post #16


Green Apple


Group: Members
Posts: 9
Joined: 24-March 11
From: St. Petersburg, Russian Federation
Member No.: 14,242



Good, that someone else confirmed it too. I also confirm that via hdparm method on XLR8 two days ago.
Go to the top of the page
 
+Quote Post
capetownMac
post Mar 28 2011, 09:20 PM
Post #17


Apple Addict
*

Group: Members
Posts: 16
Joined: 11-March 11
Member No.: 14,214



activated it via the app. it works! results not known. 2011 MBP, i7/2.3. C300.
Go to the top of the page
 
+Quote Post
Chucky
post Mar 30 2011, 10:40 PM
Post #18


Green Apple


Group: Members
Posts: 4
Joined: 30-March 11
Member No.: 14,268



I don't have the experience with hfsdebug to immediately carry this out, but via Mac OS X, here's the suggested recipe for verifying that TRIM is actually activated by this mod:

- create large test file filling it in with some pattern
- use hfsdebug (http://osxbook.com/software/hfsdebug/) to find address of the pysical sectors of the file
- use dd to verify you have got the correct address
- remove file & clean your trash
- use dd once more to make sure sectors are empty now

Do the test with the old and new kernel extensions, and you'll know if it works.

If someone knows how to work with hfsdebug, give it a try. Otherwise, I'll get around to looking at hfsdebug after a bit.
Go to the top of the page
 
+Quote Post
mRE
post Apr 4 2011, 04:20 AM
Post #19


Green Apple


Group: Members
Posts: 3
Joined: 4-April 11
Member No.: 14,281



I have a Samsung SSD in a Hackintosh. Can not get it to turn TRIM on. TRIM is supported on this drive.
Go to the top of the page
 
+Quote Post
avian
post Apr 8 2011, 04:41 PM
Post #20


Green Apple


Group: Members
Posts: 1
Joined: 8-April 11
Member No.: 14,295



Im new to this forum, stumbled upon this thread through a few web searches. And all I can say is THANK YOU!! I bought a Vertex 3 based drive today, and thanks to the info here, I now have TRIM support in 10.6.7. I cant thank you enough

This post has been edited by avian: Apr 8 2011, 05:56 PM
Go to the top of the page
 
+Quote Post
ganex
post May 13 2011, 02:54 PM
Post #21


Green Apple


Group: Members
Posts: 1
Joined: 13-May 11
Member No.: 14,375



Hi all !

I've used Trim Enabler on a MBP 2007 with a Crucial C300 SSD 256 Gb.

Worked like a charm...

Go to the top of the page
 
+Quote Post
Klaus
post Jun 24 2011, 02:57 PM
Post #22


Green Apple


Group: Members
Posts: 1
Joined: 24-June 11
Member No.: 14,463



Hi

After updating the system to 10.6.8 TRIM stopped working. The update changes IOAHCIFamily.kext to version 2.0.6.

I applied the same method changing APPLE SSD to OCZ-VERTE with an hex editor in this new version of the kext, and it works again (at least it show as activated en system profile).

Cheers - Klaus
Go to the top of the page
 
+Quote Post
machmeter
post Jun 24 2011, 10:55 PM
Post #23


Belgian Foundry
*****

Group: Moderators
Posts: 1,622
Joined: 31-March 10
From: Belgium, France, USA, Netherlands
Member No.: 12,632



QUOTE (Klaus @ Jun 24 2011, 03:57 PM) *
After updating the system to 10.6.8 TRIM stopped working.

Yes it has happened to a lot of people, I even wonder if they didn't update it just for that reason laugh.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 23rd May 2013 - 04:07 AM