Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

about enable trim on macOS sierra

hi,

after I upgrade the macos to sierra, operation is not smooth.

So I bought a samsung ssd 850 evo, and I'm going to change the HHD to SSD.

how can I use terminal to enable trim on sierra?

and is it necessary to enable trim for samsung 850 evo ssd ?

iMac, iOS 10, macOS seirra

Posted on Sep 25, 2016 10:03 AM

Reply
Question marked as Best reply

Posted on Jul 20, 2017 7:52 AM

trimforce probably makes a drive system level call, to 'enable TRIM' on the drive. Using a third party tool such as "Disk Sensei" would probably NOT add anything to that process. At most, all it can do is make that same drive system level call that trimforce is already making. In other words, if it doesn't work properly using trimforce, it won't work any better with any other tool.


The one benefit of "Disk Sensei" is that you can enable TRIM via a GUI interface and see the current TRIM status via that same GUI interface.


To view the current TRIM status for your drive via GUI interface without using any third party tools,

navigate to 'About this Mac' -> 'System Report' -> 'SATA/SATA Express' and look in the details for: 'TRIM support'

22 replies
Question marked as Best reply

Jul 20, 2017 7:52 AM in response to takeabiteoutofanapple

trimforce probably makes a drive system level call, to 'enable TRIM' on the drive. Using a third party tool such as "Disk Sensei" would probably NOT add anything to that process. At most, all it can do is make that same drive system level call that trimforce is already making. In other words, if it doesn't work properly using trimforce, it won't work any better with any other tool.


The one benefit of "Disk Sensei" is that you can enable TRIM via a GUI interface and see the current TRIM status via that same GUI interface.


To view the current TRIM status for your drive via GUI interface without using any third party tools,

navigate to 'About this Mac' -> 'System Report' -> 'SATA/SATA Express' and look in the details for: 'TRIM support'

Jul 20, 2017 7:56 AM in response to Barney-15E

I disagree. This is from wikipedia: "By 2014, many SSDs had internal background garbage collection mechanisms that worked independently of trimming. Although this successfully maintained their performance even under operating systems that did not support trim, it had the associated drawbacks of increased write amplification and wear of the flash cells.[5]" - https://en.wikipedia.org/wiki/Trim_(computing)

Jul 20, 2017 2:26 PM in response to Barney-15E

Yes, Wikipedia. My experience has been that it's a fairly reliable secondary source.


Also, as a comparison, Linux generally enables TRIM for SSD drives whenever possible. The primary reason that Apple does not enable TRIM by default for third party SSD drives is probably that they want people to buy their latest laptops that have SSD drives built in, thereby making more of a profit.


Most/all reputable SSD drives should work fine with TRIM enabled, else you would hear a big stink from the Linux community if a particular SSD drive did NOT work correctly with TRIM enabled.


If you want to argue the facts, that's fine, but disparagement by innuendo is not really helpful to the process.

Jul 21, 2017 7:03 AM in response to ginobeans

Trim is completely unnecessary on OWC SSD's; it may actually be counterproductive. To TRIM or not to TRIM (OWC has the answer) | Other World Computing Blog

A drive should not have to be told how to take care of itself. It should be self-contained. All it should require is the data to write and the data to retrieve. Every other function should be self-contained.


If you want to argue the facts, that's fine, but disparagement by innuendo is not really helpful to the process.


The primary reason that Apple does not enable TRIM by default for third party SSD drives is probably that they want people to buy their latest laptops that have SSD drives built in, thereby making more of a profit.

Ahh, yes. We wouldn't want any disparagement by innuendo.

Since Apple does not test third-party hardware, it should never enable some esoteric feature that it has no idea of the consequences. They added the capability for the user to enable it if they wish to take the risk.

Jul 21, 2017 10:08 AM in response to Barney-15E

"A drive should not have to be told how to take care of itself. It should be self-contained. All it should require is the data to write and the data to retrieve. Every other function should be self-contained."


Take a look at this article: Ask Ars: “My SSD does garbage collection, so I don’t need TRIM… right?” | Ars Technica . Basically, it explains how TRIM works *with* garbage collection to improve the performance of the SSD drive.


The underlying issue that TRIM attempts to solve is that, when files are deleted at the O/S level, the SSD drive never sees the delete -- it sees a "series of writes", so it actually does NOT have enough information to optimize page allocation. And this is an issue that *all* SSD drives would run into.


Interestingly, OWC SSD drives would also never see the delete operation as well, so without the TRIM command, it could never optimize as well as an SSD drive that used the TRIM command information.


If OWC SSD drives are not benefiting from the use of TRIM commands, it may be that they're not sophisticated enough to use the TRIM information.


BTW, for future reference, the problem with disparaging by innuendo is that it undermines your credibility and intelligence. Because the disparagement has nothing to do with the point(s) being argued.

Jul 30, 2017 6:02 AM in response to Csound1

This article discusses trim: http://www.makeuseof.com/tag/why-trim-important-to-solid-state-hard-drives/


The conclusion of the web page and I quote:


"TRIM support is a big deal. If you’re buying an

SSD now or in the future, you want it. If you already have an SSD, you should check your manufacturer’s website to see if they have a firmware update which enables it on your drive. With TRIM, your computer’s SSD will always be happily buzzing along at its maximum speed."

Jul 30, 2017 6:10 AM in response to MATT.TH

What about these regularly recommended SSD's


OWC CEO Talks SSDs, TRIM, Trimforce command

Tuesday, August 25th, 2015

| Author: MacSales.com Newsfeed


As we’ve written in the past on the Rocket Yard, with or without TRIM, OWC SSDs are built to perform over the long haul.

OWC Founder and CEO Larry O’Connor recently wrote a guest article for hardware.itbusinessnet.comto shed some additional light on OWC SSDs and TRIM.

In the article, he discusses some of the benefits and drawbacks of the command and the history of OWC SSDs and why there is no need for the TRIM command when using one.

So, not every SSD.

Sep 27, 2017 10:51 PM in response to ginobeans

I have some experience with these things as an OS architect and developer. Gino basically has it right.


At the disk level, files are made up of blocks. When an OS deletes a file, it adds those blocks to a free list and forgets the references to those blocks. The storage format of the free list and the file structure are not known to the SSD. After a block has been written for the first time, there is no real way for the SSD to tell whether it is still in use. It can't tell whether references exist to that block, because the SSD has no idea what format is used by the file system to store the references. The purpose of the TRIM command is to let the file system tell the drive (cooperatively) when a block is no longer used. In some cases, drives know enough to special-case a block consisting entirely of zeros, and can recognize "write a block of zeros" as a form of "poor man's trim".


Garbage collection does something completely unrelated, and doesn't really work unless TRIM is being used.


At the drive-level interface to the operating system, modern drives talk in terms of 1024 byte or 4096 byte blocks of data. Internally, they work in terms of 64 Kbyte or 128 Kbyte "pages". The SSD maintains a lookup table for each block telling it which page holds that block and where the block is found. This is necessary because the unit of erase on an SSD is that page, not the block. This is also the underlying mechanism that supports drive-level block compression (which is a really dumb idea, because it's the wrong place to do compression, but it makes for good marketing).


What happens over time is that you get pages that have only a few blocks of data that are still being used. The rest of the space in such a page cannot be used, because the drive can only erase full pages (it's a physical restriction down in the non-volatile memory design) and those one or two or three used blocks are standing in the way. What garbage collection does is move the used blocks to new (unused) locations in some other page so that the nearly free page becomes completely unused and can be erased. This relies on knowing which blocks are actually in use, which requires the TRIM command.


If 10% of your drive is full, you're good. You'll never see this. On bigger drives, it tends to be true that big media files get written once and then sit around for a long time without getting deleted. Because they don't get deleted we don't care about trim. Because they are big, they tend to get laid out as a bunch of full SSD pages and then one (on average) half-used SSD page. The wasted space in the pages arising from those files isn't enough that you notice.


What cruds up your drive is the stuff that is short-lived. Unless TRIM support is available, that stuff slowly but surely cruds up your drive because the drive can't tell which blocks are in use and which are free. Meanwhile, the file system generally prefers to write to previously unused blocks, because doing writes of full-page units is faster than writing a block at a time.


So:


1. YES, you really want TRIM support if it is supported correctly by your drive. If it isn't, replace the drive.

2. Apple's reluctant and belated support for TRIM on non-Apple drives is a disgrace. Every other major operating system has had this support for a decade or more. Once you do support for TRIM at all, it actually requires extra work to suppress TRIM support for third-party drives. This isn't an accident on Apple's part; it's a design decision.

3. Caveat: there are a very few SSD drives out there with known firmware bugs. These drives report to the OS that they support TRIM, but they do not actually do it correctly. On those drives, TRIM support must be turned off. The list of such drives is short, and the solution in every other OS is to maintain a blacklist of known-bad drives. I actually don't know of any SSD released in the last decade that has failed to support TRIM correctly.

4. Turning off TRIM in the file system is easy. At all the points where you would normally send a TRIM command, you either do nothing or you write a block full of zeros (to take advantage of "poor man's TRIM") instead.


My guess is that somebody within Apple decided to maintain a whitelist rather than a blacklist in the interest of reducing support burden, which makes sense because Apple fully controls the hardware choices that ship with their laptops and often uses devices that have Apple-specific firmware in the drive. Once this was in place, the pressure to fix more pressing bugs put this update off as "not important" because it only mattered to people who were "playing games" (from Apple's perspective) by installing third-party drives.


I don't know anything about Disk Sensei, but the useful thing that an application of this sort can do if written cleverly is to scan your filesystem, figure out which blocks are being used (that is: build a list) and then issue a TRIM command for every block that is not being used. This has the effect of issuing TRIM commands for all the blocks that OSX should have trimmed but did not. Once your drive is constipated, merely turning on TRIM support isn't enough; you actually have to go through and tell the drive which space is actually free.


A simple way to accomplish this without actually scanning the file system is to first enable trim support, then ask the operating system how much free space is available, then write non-zero files that consume (nearly) all of that free space (so filling it intentionally), and then delete those files. The act of deleting them induces the file system to issue TRIM commands on those blocks as the files are deleted, after which 90% or so of the unused blocks will have been TRIMmed. If 90% TRIMmed isn't enough to de-constipate your drive, you probably have more data on the drive than the drive can sensibly handle. Almost all file systems deteriorate quickly after the file system becomes 85% full (or so). The exact percentage depends on the file system and the frequency and size of file adds and deletes.


Hope some of this is a little helpful in providing understanding. Apple made sensible engineering decisions here, but they are decisions with expensive consequences for people who want to upgrade their systems.


Jonathan Shapiro, Ph.D.

Architect of the Coyotos and EROS operating systems

Oct 14, 2016 4:16 PM in response to ruilifu

I used to do on terminal, on El Capitan:

trimforce enable

but when i did it on Sierra it started freezing for no reason, adn finally stopped working with a HD error detected by Apple Hardware Test. I am not sure if that was the cause but I would suggest NOT TO ENABLE TRIM on SSD on Sierra. My SSD was an Intel 240GB Series 530

Nov 15, 2016 3:37 PM in response to ruilifu

I have "Disk Sensei by Cindori.org" .

I am running Mac OS Sierra 10.12.1 2014 MBP with an apple SSD . What I have noticed and mentioned to Apple tech support is that they no longer show "trim support" for your SSD ( I am sure this is an oversight in the OS ).

El Capitan did have trim support listed in the profile .

Cindori is supporting Mac OS Sierra and I have had no trouble with my system using Disk Sensei for trim .

This is my experience and waive any responsibility for others actions .

What I suggest is to contact cindori support and follow their instructions and recommendations

I sincerely hope this sheds some light on this conundrum

about enable trim on macOS sierra

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.