Manage SSD storage: Activate TRIM command under macOS

There are good reasons why you should activate the TRIM command for third-party SSDs under macOS. On the one hand, the access times get worse and worse after long use, on the other hand, macOS sometimes refuses to upgrade to the new version, as has just happened with a reader who could not update from macOS 10.13 High Sierra to macOS 10.14 Mojave because the Mac said the internal SSD was incompatible. How you activate TRIM for the Mac hard drive via Trimforce and what it is all about, I have summarized for you in the following.

Enabling TRIM command on macOS helps improve storage management of SSD hard drive in Mac. Here are the instructions for that
Terminal and more information on the topic.” width=”1024″ height=”484″ /> Enabling the TRIM command on macOS helps to improve the storage management of the SSD hard drive in Mac. Here are the instructions for the terminal and further information on the subject.

Before running: make a backup

Since the activation of the TRIM command changes the communication of the internal memory management of the Mac and the memory management itself is reorganized (explanation see below), a backup before the procedure cannot hurt. There shouldn't be any errors and the TRIM activation shouldn't have a negative effect on the memory, your files or the Mac itself - you can still be prepared for surprises if you back up your data beforehand;) With this link you can find “Carbon Copy Cloner” and “SuperDuper!” in comparison. Information about "BackBlaze" Is there ... here.

Activate TRIM command under macOS: Here's how!

With “Trimforce”, Apple provides an in-house command in the macOS operating system to activate TRIM on the Mac SSD - even if it comes from a third-party manufacturer. Therefore, there is a very simple solution for activating and deactivating the command: entering a single command line in the terminal. And this is how it works:

  1. Open Terminal (via Spotlight search or utilities)
  2. Enter this command in it: sudo trimforce enable
  3. Press Enter to execute the command
  4. Accept the execution of the command
  5. When prompted for the admin password, enter the same and confirm

If you want to deactivate the TRIM command under macOS, use this command: sudo trimforce disable

What is TRIM? What does the command do in detail?

TRIM is the name of a command that marks invalid and unused data blocks on a storage medium so that they can be rewritten. Within the operating system (macOS, Mac OS X, Windows, Linux) the file system driver is responsible for sending the command and the memory information to the memory controller. Using the TRIM command, the system informs the medium that these and those blocks of the memory are no longer required and can be overwritten. In addition to Linux and Windows (since 2009 and 2010), the TRIM command is also supported under macOS (since 2011) to improve storage management on SSD hard drives. More info: Wikipedia.

-
Did you like the article and did the instructions on the blog help you? Then I would be happy if you the blog via a Steady Membership or at Patreon would support.

24 Responses to “Manage SSD storage: enable TRIM command on macOS”

  1. You write that you should activate the TRIM command for SSDs from THIRD-PARTY MANUFACTURERS under macOS.
    Can I understand that the command should not be activated, for example, on a Mac mini that has not been retrofitted with its unchanged 1 TB original hard drive?

    1. Exactly, it is best not to do anything on a Mac with a hard drive installed by Apple. Everything is optimally set up from the start.

    1. Important: It is only important for third-party SSD hard drives that are retrofitted into Macs. If you bought a Mac with an SSD, you shouldn't change anything because macOS does it automatically. The boot time can only be positively affected because the trim command "clears out" the SSD and speeds it up.

    1. Hello cave! I just read a little again and on the one hand I found out that it is ESSENTIAL to create a backup before activating TRIM. If the SSD does not support TRIM, problems can arise that can even lead to data loss.

      The other thing is that you enable TRIM in the operating system, not for specific disks. This means that every internally installed hard disk should then support TRIM. Apple's own hard drives are "trimmed" by the system anyway and it doesn't matter to them whether you activate trimforce or not.
      To check if TRIM is enabled, go to the Apple menu, then About This Mac, and then System Report. Then there is the entry “SATA/SATA Express” under hardware. You should find your third-party SSD there. Nothing appears there for me because I only installed the Apple SSD.

      Important: External USB-SSDs cannot (yet) be treated with the system with "Trimming". External SSDs that are connected via Thunderbolt (as far as I could read) probably do. But you can see in the system profiler whether "sudo trimforce enable" worked or not.

  2. I have connected an external SSD to my mini, which is in a housing from UGREEN. According to the description, this case supports the TRIM command via USB C. Should I activate it now or not?

  3. Hello, I just did "sudo enable Trimforce". Booting is now clearly slower than before (the bar remains one
    Stand for a while). In addition, I saw in the system report that my SSD apparently does not support TRIM, although the Samsung 860 EVO supports TRIM according to the website. It's not that easy.

  4. Hallo,
    Last year I installed a Samsung Evo 840 1tb SSD in my MacBook Pro `12 and activated Trim, but now my hard drive only gets fuller and even if I delete something ?! Can someone help me ?

    1. Hello! I would recommend the following procedure for you (which incidentally also fixes strange problems with many Macs from time to time):
      1. Connect an external hard drive and make a 1: 1 copy of the system hard drive with CarbonCopyCloner, SuperDuper or SmartBackup.
      2. Press and hold the ALT key on restart to select the external hard drives for booting.
      3. Start the disk utility and erase the internal disk (it would be advisable to have a backup somewhere).
      4. Make a 1: 1 copy of the external hard drive on the internal one with the program of your choice from above.
      5. When restarting, hold down the ALT key and boot from the internal disk.

      Now you have basically copied everything back and forth and usually there is as much free memory as you would expect. I don't know how to solve the problem with your EVO 840. For this reason, the instructions above would be my “workaround”.

  5. Hallo,

    I did everything as described on my iMac 2019 with an external SSD. When I look under “SATA / SATA Express”, only my internal HDD is displayed there. Where could the mistake be? The command in the terminal also worked flawlessly.

    Best regards,
    Kaan

    1. Hello Kaan! Which SSD do you have? Some manufacturers are not supported on the Mac, if I understand correctly. And can you try the SSD on another computer? Just so that it is clear that it is not defective. : D

        1. Hello again ????

          I have found the mistake, but don't know how to bend it. The SSD is listed under Hardware> USB, although I plugged it in via the Thunderbolt port. Is there a solution for this?

          Thanks in advance!

          1. Phew, I don't know now. But if the iMac is fast and the SSD is recognized, everything is fine, right? It may be that it is simply a USB SSD that is connected to the Mac via an adapter. Then you use the Thunderbolt port, but USB is still practical. That would now be my unprofessional explanation.

  6. I equipped my Mac with a Samsung 2014 EVO SSD in mid-850 and would like to perform a software update.
    As soon as I press update, a small charging line appears as if it was starting with it. But unfortunately nothing happens after that. What could be the problem. The trim is activated.

    1. Hello Vova! I honestly can't help. I do not tinker with the hardware of Macs and have no experience with it. But maybe I would try to install a fresh system on an external disk and see if that works. Because if it's the internal platter, I don't see what to do. Are there maybe firmware updates or something?

  7. Hallo,

    I installed a Samsung 840 EVO (250 GB) in the Macbook, which from now on is no longer accessible (was for data, no system on it). OS X runs on a different SSD, which is also from Samsung, also installed later.

    Luckily I had a backup, but it was a month old. Instead of my defective SSD, I installed a new SSD and already installed the backup on it. But now I still try to access my data on the defective SSD in order to save the latest data.

    I connected it externally via USB and it is recognized in the disk utility, but as a deactivated volume. When I try to activate it, there is no reaction. It's full to the last KB, I think that's why it just stopped working.

    Do you think a TRIM could also cause it to release unnecessary data in retrospect so that it can be reactivated, or does that make no sense anyway because the TRIM command cannot be used on inactivated SSDs?

    Thank you very much for your help in advance. =)

    1. Hello Caspar! That's funny ... if you can speak of funny in this case ... but my wife had exactly the same case. The SSD showed up in Disk Utility, but I couldn't activate it. I gave up at some point and the SSD (it was an external one) too Sadagian sent. They were then able to restore most of the data. In our case, the folder structure was unfortunately no longer available, so that we had a lot of files in numbered folders. But if you can live with the file names (they were ok and the content was ok too!), Then that's a passable solution.

      1. Hey Jens,

        Oh, thank you very much for the super quick answer including a way out that gives hope. Because everything I could find so far was quite sobering. I even live in Hambrug and will definitely visit Sadaghian.

        Super good tip! Thanks. =)

        1. Great, I keep my fingers crossed that you can get your data out of nirvana again. PS: if you mention there that you come from Sir Apfelot, there is a 10 EUR discount. The head of Sadaghian once told me that the Sir Apfelot readers I send him are the nicest customers in the world. I can only agree with that… ;-)

Post a comment

Your e-mail address will not be published. Required fields are marked with * marked

In the Sir Apfelot Blog you will find advice, instructions and reviews on Apple products such as the iPhone, iPad, Apple Watch, AirPods, iMac, Mac Pro, Mac Mini and Mac Studio.