Sadly for Mac OS X users, TRIM support isn’t available natively. The truth is, TRIM is available in Snow Leopard, it’s just disabled for non-Apple branded SSDs. In this article, I will attempt to explain what TRIM is, why you need it for any computer fitted with a solid state drive (SSD) and I’ll show you how to enable TRIM for Mac OS X Snow Leopard.
What is TRIM?
To first explain what TRIM is, you’ll need to understand how data is written and deleted on hard disks. You see, a regular spinning hard disk writes data linearly and actually doesn’t remove data immediately. After you empty the Trash (or Recycle Bin), the system just flags the space occupied on that particular part of the drive as empty or “free”. Whenever the system needs to write new data on that space, it firsts deletes any occupying data and then writes the new data on it.
On an SSD, this process slightly different: data is stored in flash memory cells that are grouped into pages. 128 pages are then grouped into blocks. And deletion procedures can only be carried out on the block level i.e. the entire block has to be first cached (read and stored in memory cache), the block erased, then the cached block is modified to include the new data and finally written on the flash media again. This is called the read-erase-modify-write cycle. Sounds tedious, right?
Simply put, TRIM is a command sent from the system to the SSD, telling it to perform the read-erase-modify-write cycle whenever a file is deleted instead of waiting until there is new data to be written. Why is this better? Because ultimately, the SSD’s write performance will remain unaffected over time. Only the deletion process takes a little longer.
How to enable TRIM support in Mac OS X
Before you even begin to attempt to enable TRIM support in Mac OS X, check if your SSD supports TRIM. Older SSDs will require a firmware upgrade.
Surprisingly, enabling TRIM for Mac is pretty easy. All you need to do is brace yourself, then download the TRIM Support Enabler for Mac OS X Snow Leopard. It’s a ZIP file, so umcompress it first then double-click the unzipped application, TRIM Support Enabler.
Click on Patch and follow the on-screen instructions. And you’re done. If you take a look at System Profiler, you will be able to confirm if TRIM has indeed been enabled.
After enabling TRIM for Mac OS X
After you’ve successfully enabled TRIM, it’s generally a good idea make the system delete all of the free space on your SSD so that free space is indeed unoccupied.
Open Disk Utility and select your SSD in the left pane. Then click on the Erase tab.
Now click on Erase Free Space…
In the popup window that appears, select “Zero Out Deleted Files” which is basically the quickest procedure. Then click on the Erase Free Space button.
Wait until the process is complete, which could take quite a while. Remember, TRIM slows down the deletion process.
Once that is done, launch Terminal and copy and paste the following commands individually.
sudo chown root:admin /
(wait and enter your password when prompted)
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
This is to prevent OS X from slowing down during startup, which usually happens after erasing free space.
So that’s it. That’s how to enable TRIM for Mac OS X and prep your SSD to work with TRIM. Questions? Submit them in the comments, friends.