Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DominikHoffmann

macrumors 6502
Original poster
Jan 15, 2007
477
468
Indiana
I am wondering, whether I need to set TRIM manually on Macs I have upgraded from having hard drives to SSDs? I know that at least several years ago, this was not automatically turned on. With the later APFS-based version of macOS, however, will TRIM be enabled on SSDs automatically?
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,664
4,086
New Zealand
I'm about 90% sure that I had to enable it manually on a 2014 Mini, even under OS 12 (the latest version supported on that machine). I think System Profiler still shows whether or not it's enabled.
 

Basic75

macrumors 68000
May 17, 2011
1,986
2,334
Europe
TRIM or garbage collection should be pretty much automatic on today's ssd, i know they were a pretty big deal when the intel x25 came out but nowadays any modern ssd has it in its firmware.
Garbage collection is a function that is built into the SSD and will run automatically without having to be turned on. It requires the SSD knowing which data is garbage that can be collected, which happens in two ways.

First, if a logical sector number is written again then the drive knows that the old content of that sector is garbage. This too, is handled automatically and transparently by the SSD since it has everything it needs to do the job.

Second, when a file is deleted the operating system has to explicitly notify the SSD via TRIM that certain sectors are no longer needed and are in fact garbage. This can not be handled by the drive automatically because in order to do so it would reliably need to know which data was deleted by analysing the filesystem's on-disk data structures! The drive would need to know the implementation details of at least ExFAT, NTFS, EXT2/3/4, HFS+ and APFS, and receive firmware updates as these formats possibly evolve. That is just not practical.

Since making sure that TRIM is enabled doesn't need more than a "sudo trimforce enable" in Terminal.app that's exactly what I would do.
 

Basic75

macrumors 68000
May 17, 2011
1,986
2,334
Europe
The firmware would need to "know" APFS so would likely vary by brand.
I don't believe any SSD ever attempted to parse the filesystem data it contains to perform what amounts to automatic TRIM. You'd be adding a ton of complexity to the firmware in a place that can under no circumstances afford to make a mistake. Does anybody know a drive that does this?
 

Basic75

macrumors 68000
May 17, 2011
1,986
2,334
Europe
Is there a way to check whether TRIM is enabled in Terminal?
I'm not quite sure. System Report used to give this information, but in their infinite wisdom Apple got rid of that a couple of macOS versions ago. There was a long discussion on this subject on this site, but I can't remember a clear and simple solution, and I'm not at all afraid of Terminal.app.
Edit: @Juicy Box is right, for NVMe attached drives the information can still be seen in System Report. It's unclear with SATA or USB drives.
 
Last edited:

Juicy Box

macrumors 604
Sep 23, 2014
7,530
8,864
I guess everyone will have their own opinion on how to handle TRIM, but I suggest enabling it unless you have issues with your specific SSD with TRIM enabled, then disable it.

I have only seen one or two threads about drives acting screwy with TRIM enabled, so chances of this happening is pretty slim I bet.

The benefits of having TRIM enabled on the OS level would be worth enabling it, if it currently isn't.


Is there a way to check whether TRIM is enabled in Terminal?

You can see it with the GUI in the built-in System Information app, otherwise known as System Report.

The app itself looks a little different depending on the OS you are using, but pretty much the same general layout for the last 15 years.

If you are using a NVMe SSD, then click NVMe on the left hand side column, and click on your drive from the device tree if it is not already selected, and go down to TRIM Support. If it says "Yes", then TRIM is enabled. If "No", then it is not.


With the later APFS-based version of macOS, however, will TRIM be enabled on SSDs automatically?
I'm about 90% sure that I had to enable it manually on a 2014 Mini,


I could be wrong, but in my experience, if the Mac came with a SSD, either pure or in a Fusion Drive set up, then TRIM is automatically enabled.

For any Mac that only shipped with just a HDD, TRIM is automatically disabled, and you can easily enable it using Terminal.

It only takes a few seconds, and just copy and past in the command.
 
  • Like
Reactions: Basic75

Juicy Box

macrumors 604
Sep 23, 2014
7,530
8,864
System Report used to give this information, but in their infinite wisdom Apple got rid of that a couple of macOS versions ago.
Yeah, pretty dumb. I just noticed it was gone from Ventura, but it is still there with Big Sur.

Either way, you can still open System Information using the built-in search or accessing the app in the Utilities folder.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.