Enabling TRIM is one of the best ways to maximise the life of your solid-state drive, but OS X doesn't support it out-of-the-box. Here's an easy way to get better performance and longevity out of your Mac's SSD.
TRIM support is coming in OS 10.7 Lion, but that's still a way off, and even then, it'll only work with Apple SSDs. If you have a non-Apple SSD, or you just want to get TRIM support now, previously mentioned TRIM Support Enabler will do it for you. However, it turns out there's a little more to it than just hitting the "Patch" button. Here's how to maximize your TRIM benefits.
Should I Use TRIM Enabler?
TRIM Enabler won't work for all SSD users. You should not use TRIM Enabler if:
- Your SSD doesn't support TRIM. The only way to figure this out is to Google your SSD's model number and find out if it supports TRIM. Note that the "TRIM Support" line in System Profiler does not tell you whether TRIM is supported, only if it's enabled. So even if it says "No" in System Profiler, you should still Google your drive to see if it supports TRIM. Also note that you might need to update your firmware to get TRIM support, and you can find instructions on how to do that on the manufacturer's web site.
- Your SSD already has built-in garbage collection. TRIM and garbage collection are similar, but they are not the same thing. Unfortunately, for some reason, the Apple driver for TRIM seems to conflict with drives that have garbage collection built-in to the controller, so you won't want to use it. It'll actually decrease your drive's performance.
Adding TRIM Support to OS X
First, make sure you've updated to at least Mac OS X 10.6.7, as Trim Enabler won't work on previous versions of OS X. Once you've updated to 10.6.7 and verified that your SSD supports TRIM, you're ready to roll. Download and fire up Trim Enabler. Before you do anything, hit the "Backup" button—this will back up the kernel extension to any folder you want, so that if the patched extension doesn't work, you can restore the old one without a problem.
Once you've backed up, go ahead and hit "Patch". When it's done, restart your computer. If you open up System Profiler (by going to /Applications/Utilities/System Profiler), hit Serial-ATA in the sidebar and choose your SSD in the topmost pane, you should notice that your drive will show "Yes" under "TRIM Support". That means it worked correctly.
If it didn't, or if your computer is having issues booting, boot into safe mode by holding Shift when you boot up. If you're on a Hackintosh, boot into safe mode by typing -x at Chameleon's main screen. You'll boot right into OS X, after which you can open up TRIM Enabler and hit the "Restore" button to restore the original extension that you backed up earlier.
Improving Your SSD's Performance
TRIM may be working now, but if you've had the SSD for awhile, you've probably already lost a little bit of performance from not having TRIM all that time. You can clean up your drive and get some of that performance back by zeroing out your drive and running a few Terminal commands.
First, open up Disk Utility. Select your SSD in the sidebar and go to the "Erase" tab. Click the "Erase Free Space" button, and let it do its thing. (Ot could take up to 15 minutes or so, and might slow down your computer a few times. I'd just step away from the computer and leave it alone for a while).
When that's done, open up a Terminal window and type the following commands, hitting Enter and letting the command finish after each line:
sudo chown root:admin /
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
(You'll know when a command finishes because the prompt will come back with your computer's name). These commands will clear some of your caches that can slow down your boot time.
From now on, you should see a bit of an decrease in your computer's boot time and an increase in performance. The longer you've had your SSD, the better that improvement will be. Note that you only need to follow these steps once, since you're basically making up for the performance degradation you got from not having TRIM enabled. Now that you have TRIM support, your drive should keep its high performance instead of degrading over time.
Also note that some OS X updates might revert you to your old, TRIM-less state. So, when you update OS X, be sure to check System Profiler and see if TRIM is still enabled. If it's not, run the patch again. After you re-patch the system, you should be fine (again, you won't need to run the above commands again).
That's it! Now you should be getting a bit better life and performance from your SSD. For more information on this process and the intricacies behind whether or not you should use TRIM Enabler, hit the link below to go to the full thread on MacRumors. And, if you try it out, be sure to share your experiences with us in the comments.
TRIM Support Enabler [MacRumors]