Enable TRIM for Any SSD in OS X (Yosemite 10.10.4 or Later)

Keep the SSDs you add to your Mac in top shape

Ever since Apple first offered Macs with SSDs (solid-state drives), they've included support for TRIM, a method that helps the operating system free up space. It also helps prolong the drive's life and promote efficient operation.

The information here applies to Mac OS X Lion (10.7) and later, as well as all versions of macOS up to the latest [currently, 10.15 (Catalina)].

Generic SSD
APFS is optimized for use with SSD's.  Wladimir Bulgar / Getty Images

The TRIM Command

The TRIM command helps the OS clean up data in storage blocks that are no longer needed. This optimizes the write performance of an SSD by keeping more blocks of data free to be written to. It also prevents the SSD from being so aggressive in cleaning up after itself that it causes wear on the memory chips. In this way, it prevents premature failure.

TRIM is supported in OS X Lion (10.7) and later for all drives, but it's enabled by default only on Apple-supplied SSDs. It’s not clear why Apple limited TRIM support this way, but the conventional wisdom is that TRIM implementation is up to the SSD manufacturer, and each one uses a different TRIM methodology. As such, Apple chose to use TRIM only on SSDs that it has certified.

A few third-party utilities can enable TRIM for non-Apple-supplied SSDs, including TRIM Enabler. These utilities make use of Apple’s built-in TRIM support while removing the ability of the OS to check if the SSD is on Apple’s list of approved manufacturers.

Should You Use TRIM?

Some early-generation SSDs had unusual implementations of the TRIM function that could lead to data corruption. For the most part, these early SSD models are difficult to come across, unless you picked one up from a source that specializes in used products, such as flea markets, swap meets, and eBay.

Always check the SSD manufacturer's site for any firmware updates for your particular model.

Make sure you have a backup system in place before enabling TRIM. Failures caused by TRIM can involve large blocks of data being reset, causing non-recoverable file loss.

Is Your Mac Running TRIM Already?

If your SSD came installed on your Mac, TRIM is on by default. However, if you added an SSD later, it might not be. Here's how to check:

  1. Click the Apple icon in the top-left corner of your screen.

    About This Mac
  2. Select About This Mac.

    About this Mac.
  3. Choose System Report.

    macOS System Report
  4. Go to Hardware > SATA/SATA Express.

    macOS SATA/SATA Express info
  5. Scroll down to TRIM Support. If the value is "yes," you don't need to turn it on. If not, keep reading.

    TRIM Support setting.

Enabling TRIM

To turn TRIM on:

  1. Open Terminal.

    Terminal app icon in macOS Finder window
  2. At the prompt, type

    sudo trimforce enable 

    Press enter.

  3. Type your password when prompted, and hit enter.

  4. Type y at the prompt to indicate you want to proceed, and press enter.

  5. Type y again at the prompt. Your system will reboot.