In OS X Lion how do you enable TRIM support for SSDs?
Right now Apple's TRIM support seems to be limited only to Apple SSDs, though. I am running an Intel X-25M (G2, or second-gen) SSD in my MacBook Pro, and this SSD does support TRIM, however there's no apparent way to enable it in Lion. Anyone have pointers on this?
See also: www.macrumors.com/2011/06/27/mac-os-x-10-6-8-bring...
Instead, you can run the following Terminal commands:
So, here's the proper way to enable TRIM support. Copy these commands out, find/delete all "[REMOVE ME]" placeholders so the commands are contiguous, and run them in Terminal:
→ Backup the file we're patching:
sudo cp /System/Library/Extensions/IOAHCIFamily.[REMOVE ME]kext/Contents/PlugIns/IOAHCIBlockStorage[REMOVE ME].kext/Contents/MacOS/IOAHCIBlockStorage /IOAHCIBlockStorage.original
→ Patch the file to enable TRIM support:
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61[REMOVE ME]\x6C\x00).{9}(\x00\x51)|$1\x00\x00\x00\[REMOVE ME]x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.[REMOVE ME]kext/Contents/PlugIns/IOAHCIBlockStorage[REMOVE ME].kext/Contents/MacOS/IOAHCIBlockStorage
→ Clear the kext caches
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
→ Now, Reboot!
→ If in the future you want to disable TRIM support:
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61[REMOVE ME]\x6C\x00).{9}(\x00\x51)|$1\x41\x50\x50\[REMOVE ME]x4C\x45\x20\x53\x53\x44$2|sg' /System/Library/Extensions/IOAHCIFamily.[REMOVE ME]kext/Contents/PlugIns/IOAHCIBlockStorage[REMOVE ME].kext/Contents/MacOS/IOAHCIBlockStorage
→ Or if something goes horribly wrong, restore the backup:
sudo cp /IOAHCIBlockStorage.original /System/Library/Extensions/IOAHCIFamily.[REMOVE ME]kext/Contents/PlugIns/IOAHCIBlockStorage[REMOVE ME].kext/Contents/MacOS/IOAHCIBlockStorage
All the patch does is edit the IOAHCIBlockStoage file, patching out the string "APPLE SSD" to zeros. This happens to enable TRIM support for all SSDs.
Please visit my post about these Terminal commands here: digitaldj.net/2011/07/21/trim-enabler-for-lion/
43 people like this answer
Clicking the mark as good answer button helps us highlight the best answers.
groths.org/?p=308
groths.org/zeus/TRIMEnabler.zip
I have NOT tested this, and have no idea if it's going to blow anything up in Snow Leopard, Lion, or otherwise.
Lifehacker also wrote a pretty good looking guide here: lifehacker.com/5803331/how-to-enable-trim-on-your-...
Has anyone had any luck with it thus far?
4 people like this answer
I foolishly forgot to make a back up with the Trim Enabler app and now after reading this, I'm starting to get worried. What should I do?
Capacity: 180,05 GB (180.045.766.656 bytes)
Model: OCZ-VERTEX2
Revision: 1,280000
...
TRIM Support: Yes
2 people like this answer
1 person likes this answer
0 people like this answer
INTEL SSDSA2M160G2GC:
Capacity: 160.04 GB (160,041,885,696 bytes)
Model: INTEL SSDSA2M160G2GC
Revision: 2CV102HD
...
TRIM Support: No
...
maybe some caching is involved?
0 people like this answer
Cheers,
0 people like this answer
0 people like this answer
0 people like this answer
0 people like this answer
-bash: syntax error near unexpected token `.{9}'
0 people like this answer
The reason? Got an OCX Agility 3 (480 GB) that worked fine in a Windows machine, then got another 240 GB one (same brand & type) and replaced, so that I could use the bigger one on my Macbook Pro (Late 2008, last one with removable battery, I think, 15" screen, Processor 2,8 GHz Intel Core 2 Duo, 4 GB RAM, NVidia chipset & screen adapter - 9600).
Ok, here is the story.
Right after I installed a fresh copy of Lion (used the USD stick method, works nice) I checked and there ws no TRIM enable in the System Info. After a quick Googlation, I found you guys.
The script method to patch the kext works... well, sort of.
I guess I am one of those people that repeated the same process that Apple went through! The trouble is, I believe, in the NVidia MCP79 AHCI controller.
Symptoms? Machine overheating and commanding me to shut down with the power button after intense disk activity (I was restoring the Bootcamp partition with Winclone, happened twice). I had also noticed some heating on the SSD unit, but really I wouldn't know what would be right, since it was being heavily used at the moment.
Also, lots of stuttering and brief freezing in applications (example: Safari...)
I don't know if t is the Apple machine or the SSD that would get hurt the most - but quite frankly... I don't want to know. Something the guys at Apple already know, I presume.
Just sharing my (not so great) experience...
Important Note!... Please remember that I did NOT persist in using the SSD WITHOUT the patch (i.e. Apple trim enabled).
Since the SSD is a Sandforce controlled device, very recent (firmware release 2.22), I wonder if TRIM would have been active, even when Apple says it is not.
Anyone has experience with recent OCZ SSD (mine is Agility, but the only difference between Agility and Vertex is asynchronous/synchronous RAM, I guess).
Another thing: This machine heats a lot, but never before to the point of asking for a power down - it has a Toshiba 1 Terabyte HDD.
Best regards to All.
0 people like this answer
share:
Products mentioned
36 users following this question, including:
This question has been viewed 45558 times.
Last activity .