What is TRIM and How To Enable TRIM for Mac OS X?

trim-for-mac.png

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.

trim for mac

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.

trim for mac

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.

trim for mac

Now click on Erase Free Space…

trim for mac

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.

trim for mac

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.

About author
Jackson Chung, M.D. is the founder of TheDailyBuggle. He is also the Associate Editor for MakeUseOf. When he's not working, you'll find him fiddling with his camera and enjoying chai latté. Catch him (if you can) on Twitter @aenon1mus. He encourages you to join TheDailyBuggle on Facebook and Twitter.
7 total comments on this postSubmit yours
  1. is there a trim-like system for windows 7? how can I enable it? mail me please.

    • Windows 7 is the only operating system with TRIM. You don’t need to install it.

  2. This sudo command fixed my slow ssd startup. Now back to 3 spins and go!!! Thanks!!

    • Awesome, right?

  3. Can i still do that sudo command even though i already have a TRIM enabled Apple SSD?

    • You don’t need to. The sudo command is only for those who have just activated TRIM.

  4. Thanks for the reply!
    Weirdly though after i typed the previous comment, i went ahead and typed in the sudo command which made my boot up time way faster than before without a single gear spin. I wonder if my Apple SSD TRIM was being lazy and not doing what it should be doing (writing zeros to free space in the background), because before coming to this site my boot up time lasted 7 gear spins. Your sudo command really helped, can you explain what that command actually does to your system?
    last question i promise

Submit your comment

Please enter your name

Your name is required

Please enter a valid email address

An email address is required

Please enter your message

Tip Us!

Read an interesting story elsewhere and would like to see TheDailyBuggle cover it? Got a good tip you'd like to share with us? Tip us by sending an email to the Editor-in-Chief.

TheDailyBuggle © 2013 All Rights Reserved

Designed by WPSHOWER

Powered by WordPress