Question Trim function on external SSDs ?

liberty610

Distinguished
Oct 31, 2012
466
5
18,815
Hello all.

I have a Sabrent enclosure for M.2 SSD drives with a 2TB Western Digital Black SSD in it. I noticed that Windows 11 doesn't seem to run the trim command over USB. So is running trim on an external SSD needed? Or is it done by the drive's firmware?
 
SCSI UNMAP is the equivalent of the TRIM command over USB. TRIM is something that the OS does -- the SSD doesn't do this on its own. Basically the OS is telling the SSD that the data in specified sectors is no longer required -- the SSD has no way to make this decision on its own.
 
  • Like
Reactions: Maxxify

liberty610

Distinguished
Oct 31, 2012
466
5
18,815
SCSI UNMAP is the equivalent of the TRIM command over USB. TRIM is something that the OS does -- the SSD doesn't do this on its own. Basically the OS is telling the SSD that the data in specified sectors is no longer required -- the SSD has no way to make this decision on its own.
Thank you for the reply. I'm not sure how to perform this SCSI UNMAP command. Any help there?
 

MWink64

Prominent
Sep 8, 2022
156
42
620
Crucial says their MX500 model is designed to work without TRIM.........so perhaps TRIM is not needed after all ?

No SSD needs TRIM but it's basically always beneficial. You can somewhat mitigate the lack of TRIM by not filling the drive as much. This is most easily accomplished by leaving a portion of the drive unpartitioned. The issue arises from the fact that once data has been written to a particular LBA, without TRIM (or an equivalent), the controller will always believe valid data is stored there. TRIM is what allows the host OS to inform the drive that there is no longer valid data at a particular location, such as if a file has been deleted.
 
  • Like
Reactions: liberty610

liberty610

Distinguished
Oct 31, 2012
466
5
18,815
No SSD needs TRIM but it's basically always beneficial. You can somewhat mitigate the lack of TRIM by not filling the drive as much. This is most easily accomplished by leaving a portion of the drive unpartitioned. The issue arises from the fact that once data has been written to a particular LBA, without TRIM (or an equivalent), the controller will always believe valid data is stored there. TRIM is what allows the host OS to inform the drive that there is no longer valid data at a particular location, such as if a file has been deleted.
As it turns out, Windows 11's optimize disk option actually sees the external SSD in the list and has TRIM available as an option. I was able to run TRIM without any issues on it.

Thanks!
 
Apr 15, 2024
1
0
10
As it turns out, Windows 11's optimize disk option actually sees the external SSD in the list and has TRIMM available as an option. I was able to run TRIM without any issues on it.

Thanks!
How did you do it? Did it just appear? Defragmenter only finds my external SSD as an HDD
 

liberty610

Distinguished
Oct 31, 2012
466
5
18,815
How did you do it? Did it just appear? Defragmenter only finds my external SSD as an HDD
I'm assuming is there is a few of reasons for it working for me. I really don't know for sure how Disk Optimizer in Windows 11 sees my external SSD and runs trim on it. The one thing that I do notice is, when I open Disk Optimizer, it says Trim option is there but has never been ran, even though I have ran it several times over the past few weeks.

I have a higher end motherboard (it's a few years old now, but still getting BIOS updates with the latest version being released last month) in the Gigabyte x570 Xtreme board. I also have a PCIe card with USB-C inputs that are wired for high voltage and data transfer. That is paired with a 240wat/40Gbps USB-C cable to my Sabient M.2 enclosure. The drive in my enclosure is a WD Black PCIe Gen 4 drive. Some how these all paired together give me the option to run trim.
 
external enclosure and usb controller needs to support UASP for trim/unmap to work
easy to check in device manager
UASP.png
 
  • Like
Reactions: liberty610