In solid-state drives (SSDs), TRIM is a command that helps, well, trim down the unnecessary writing to a solid-state drive (SSD) hence maximizing its life span.
Even an SSD of extreme endurance, like the Samsung 970 PRO, can quickly become unreliable with TRIM disabled.
This post will walk you through the process of checking the TRIM status and enabling it on a Windows or a Mac computer.
Dong's note: I first posted this piece on May 23, 2018, and updated it on March 30, 2021, with additional relevant information.
SSD TRIM command: What is it?
TRIM is literally a command, it's not an acronym.
This command is complementary to an SSD's garbage collection where the drive organizes its cells in preparing for writing. It preemptively notifies the SSD which data pages in a particular block can be erased.
Consequently, TRIM helps the drive's controller to work more efficiently and reduces the amount of unnecessary writing, called write amplification, on the drive, hence, prolonging the drive's longevity.
How to work on the SSD TRIM command on a Windows computer
These steps apply to Windows 7, 8, 10, and 11. Older Windows versionsโif you still use them for some reasonโdon't support TRIM. As a result, yous shouldn't use SSDs with them.
How to check the SSD TRIM on a Windows machine
- Use the Windows key + X keyboard shortcut (press and hold the Windows key, then press on X). Alternatively, you can right-click on the Start button to bring up the Power User menu. Now select Windows Powershell (Admin). (On earlier versions of Windows, you can use the Command Prompt (Admin).
- Type in the following command into the Powershell window, then press Enter. (You can also copy and paste it.)
fsutil behavior query DisableDeleteNotify
If the command returns 0 (zero), you're all good. Despite the fact you see the word "(Disabled)," TRIM is enabled on the computer, and there's nothing else you have to do.
If not, you need to enable it.
How to enable/disable TRIM on a Windows computer
- Use the Windows key + X keyboard shortcut to bring up the Power User menu, and select Windows Powershell (Admin).
- To enable TRIM, enter the following command in the Powershell window, then press Enter:
fsutil behavior set DisableDeleteNotify 0
To disable TRIM (if somehow you want to do that), use the same command but substitute 0 with 1
fsutil behavior set DisableDeleteNotify 1
And that's it. You can rest assured you've taken the necessary steps to ensure your SSD will work well and last on your Windows computer.
How to work with the SSD TRIM command on a Mac
Things are a little different on a Macโit's slightly more complicated or simple, depending on how you look at it.
All new MACs come with an SSD internal drive with TRIM already turned on by default. You can't even change or upgrade the internal storage for most of them.
That said, checking the SSD TRIM command is only necessary with models that allow you to change the internal drive. In that case, these steps apply to most versions of macOS.
Checking SSD TRIM on a Mac
- Click on the Apple icon (top-right corner), then choose About This Mac.
- Click on System Report.
- On the left pane of the System Information window, under Hardware, navigate to SATA/SATA Express (if you use a standard SATA SSD) or NVMExpress (if you use an NVMe SSD). It doesn't hurt to check both sections.
- On the right pane, scroll down until you find TRIM Support. If the value is Yes, then TRIM is runningโyou're all good! Otherwise, go to the next step.
How to enable SSD TRIM on a Mac
Again, it's important to note that the SSD TRIM on a Mac can be complicated and might not work the same for all SSDs. If your machine comes with an SSD, TRIM is automatically enabled (or disabled for a particular reason).
You should check with your vendor to make sure an SSD supports your Mac before installing it on the machine, and then tread lightly with the next steps.
- Run Terminal (you can search for it using Spotlight at the top right corner)
- Type in the following command and press enter:
sudo trimforce enable
You'll need to enter the password (of your Mac account) and confirm that you want to enable TRIM. Answer those prompts affirmatively (again, make sure your SSD supports the Mac). The machine will restart with TRIM enabled.
Extra: TRIM and (USB) portable SSDs
It's worth noting that generally, the USB connection doesn't support TRIM. Consequently, when you use a portable drive via USB, there's no way to enable TRIM on it.
However, most of these drive comes with firmware that supports wear-leveling, and since USB can be relatively slow, the lack of TRIM support doesn't affect the drive's positivity.
It's worth noting that Thunderbolt supports TRIM, and starting with USB4 and Thunderbolt 3, these two peripheral connection types have slowly merged.
The takeaway
The most important thing about SSD TRIM is that it's enabled. I've seen good SSDs deplete their writes in months or even days, in normal use, with TRIM turned off.
If you install a new (or even used) SSD on a computer, checking to make sure TRIM works properly is the first and most important step. Also, don't use SSDs with an operating system that doesn't support TRIM.
If Trim is enabled in Windows 10, does that take care of external SSDs as well?
I actually received two returns to the command, one for “NTFS” and one “ReFS”, both disabled.
When enabled in Windows, TRIM is supported whenever applicable, Deb. If you use a USB drive, though, TRIM is *likely* not applicable since USB doesn’t support it. But generally, USB is relatively slow so it won’t matter much. Thunderbolt supports TRIM.
USB4 and Thunderbolt 3 are the same things so if you use a USB4 drive, it’ll support TRIM. More about USB vs TB in this post.
Hi!
Just a question.
Is it possible to recover deleted files after emptying trash on mac with trim ssd enabled/support?
Regards
Generally no. It can be tough to recover deleted data on an SSD due to how information is written. More here. This, of course, depends on how long the information has been removed, etc. Many SSDs tend to optimize on their own, including removing data from cells marked as “free”.
Thanks for the response! Looks like i have no luck retrieving my deleted files ๐ no point in sending my mac for recovery service.
Curious. Any idea how often an Apple SSD ‘trims’ itself? is it periodically or instantly when a data is deleted
That depends on a particular SSD’s controller. But you need backups, you can NEVER count on data recovery. If you delete something, it’s supposed to be GONE.
nmve sn 530 trim unsupported ! helpme
All SSDs support TRIM, Cong.
I upgraded from the original SATA HD in my macbook pro to a 1 TB Samsung SSD in 2016 and did have to activate TRIM then. I am now going to install a 2 TB Samsung 870 EVO (thanks for your review btw). Does this process need to be done again or will it remain activated?
You should check, Sanjaya. Generally, on a MAC, you have to do that for each drive.
I will! Thanks for the great article Dong
Thanks man! helped me a lot!
Sure, Lucas! That’s great!
Windows? Mac? Yup. Run them both. But my Samsung 960 is in my Linux desktop PC. 7 of the home machines run Windows of all flavors, 2 run MacOS, & 12 run Linux (or BSD). It doesn’t have to be Windows OR Linux, I’m sure there’s many users like myself that run varying OS depending upon need. We’re out here. Linux may dominate the Web-server world, but there’s plenty of desktops out there running Linux, & for good reason. Each platform has it’s pluses & minuses, thinks it does better than the others, but for day to day stuff: Linux.