Page 1 of 1

Don't forget the Trim!

Posted: Sun Sep 10, 2023 12:25 pm
by James Steele
LOL... so my old 250GB SSD in my office MacPro was getting very full and I was getting warnings. So, eureka! I had a 1TB SATA SSD that I had pulled from my Studio Mac Pro when I retired it for the Mac Studio. I popped in a drive bay in my office MacPro (running High Sierra), reformatted it, then used CCC to clone my boot drive to it. It all worked like a champ.

Then I began noticing things getting pretty slow. Web browsing was slow. Even saw a message at bottom of browser window saying waiting on cache, etc. Might have been to write to it, read, don't remember. But something wasn't right. Many things seemed abnormally sluggish.

Aha! I had been using this as a projects drive and not a boot drive previously. And maybe because I reformatted that was the issue, but realized Trim was not enabled. I went to Terminal and used sudo trimforce enable and Bob's my uncle again. Seems like after it rebooted and settled in, things are behaving like the should again. Huzzah!

Re: Don't forget the Trim!

Posted: Sun Sep 10, 2023 6:50 pm
by mikehalloran
Yep. Always possible that Garbage Collection is disabled in the firmware on that old SSD. TRIM is part of the MacOS since 10.6.8 but is blocked for 2.5" SSDs unless you unblock it with that Terminal Command. Apple never built a Mac with a 2.5" SSD.

It works over Thunderbolt, SATA, eSATA and PCIe. It doesn’t work over USB or Ethernet. TRIM is enabled by default on blade type SSDs including the SATA III blade used on some 2012 iMacs.

Re: Don't forget the Trim!

Posted: Sun Sep 10, 2023 7:50 pm
by HCMarkus
mikehalloran wrote: Sun Sep 10, 2023 6:50 pmIt doesn’t work over USB or Ethernet..
Good to remember. That’s why I only use USB connected SSDs for “Mostly Read” applications. Or just reformat the drive now and then… I have one I use for daily working project backups (in addition to automatic Time Machine and BackBlaze) that gets wiped whenever I transfer the project files to long term storage.

Don't forget the Trim!

Posted: Sun Sep 10, 2023 8:25 pm
by James Steele
What about NVMe drives in USB4 enclosure? Do they even need trim? I guess since I’m using it for sample libraries it’s a “mostly read” situation.

Re: Don't forget the Trim!

Posted: Sun Sep 10, 2023 8:42 pm
by mikehalloran
James Steele wrote: Sun Sep 10, 2023 8:25 pm What about NVMe drives in USB4 enclosure? Do they even need trim? I guess since I’m using it for sample libraries it’s a “mostly read” situation.
TB4 is built on the USB 4 spec—possible that the only real difference is the fact that TB3/4 is licensed and certified by Intel. If connected via a TB3/4 cable, a blade in a USB 4 housing might support TRIM. I’ve not read one way or the other. I’ve been meaning to ask.

It will be easy to see in a System Report. TRIM Support will be Yes or No. There’s no way to enable or disable it. Garbage Collection is normally good enough but with TRIM, preparing cells for new data is a lot faster. I have recent experience wiping and rewriting nearly full 4TB SSDs.

Re: Don't forget the Trim!

Posted: Sun Sep 10, 2023 9:42 pm
by James Steele
mikehalloran wrote: Sun Sep 10, 2023 8:42 pm
James Steele wrote: Sun Sep 10, 2023 8:25 pm What about NVMe drives in USB4 enclosure? Do they even need trim? I guess since I’m using it for sample libraries it’s a “mostly read” situation.
TB4 is built on the USB 4 spec—possible that the only real difference is the fact that TB3/4 is licensed and certified by Intel. If connected via a TB3/4 cable, a blade in a USB 4 housing might support TRIM. I’ve not read one way or the other. I’ve been meaning to ask.

It will be easy to see in a System Report. TRIM Support will be Yes or No. There’s no way to enable or disable it. Garbage Collection is normally good enough but with TRIM, preparing cells for new data is a lot faster. I have recent experience wiping and rewriting nearly full 4TB SSDs.
Only way I could see a reference to Trim Support was by navigating the the NVMExpress section and it shows me the WD Blue NVMe drive in my USB4 enclosure. it says that Trim is supported (indicated by the red arrow). I'm not sure if it's already operating this way, or I still have to force it with the Terminal?

What's interesting is the 209MB EFI volume thats formatted FAT32. I guess that's a standard thing. I'm pretty sure I reformatted that drive when I bought it to APFS... and you can see the Sample Libraries volume underneath the EFI volume that is indeed APFS format.

nvmeusb4trimsupport.jpg
nvmeusb4trimsupport.jpg (64.73 KiB) Viewed 3224 times

Re: Don't forget the Trim!

Posted: Mon Sep 11, 2023 9:31 am
by mikehalloran
James Steele wrote: Sun Sep 10, 2023 9:42 pm
Only way I could see a reference to Trim Support was by navigating the the NVMExpress section. I'm not sure if it's already operating this way, or I still have to force it with the Terminal?

What's interesting is the 209MB EFI volume thats formatted FAT32. I guess that's a standard thing. I'm pretty sure I reformatted that drive when I bought it to APFS... and you can see the Sample Libraries volume underneath the EFI volume that is indeed APFS format
Now we know. TRIM is unblocked by default over USB 4. There’s no command to block or unblock except for 2.5" SSDs that I know of. When TB5 is released next year, it will be based on the USB 4.2 spec — safe to assume it will be the same.

It’s quite possible that the FAT32 volume is the culprit—GC only works in it?—but that’s a guess. Without knowing the drive firmware, that’s as good as I can do. Since unblocking TRIM solves the problem, I’d declare victory. Otherwise, there may be a firmware update for the drive that would address this.

Re: Don't forget the Trim!

Posted: Mon Sep 11, 2023 11:24 am
by James Steele
Yeah... the screenshot was from my Mac Studio in my studio. That's where I have the NVMe drive in the USB4 external case.

The problem I was having was with my MacPro in my office. I installed a 2.5" SSD into it had been the projects drive in a different MacPro that I used to use in my studio. It was solved when I force enabled trim on that drive.

Re: Don't forget the Trim!

Posted: Mon Sep 11, 2023 10:31 pm
by Michael Canavan
James Steele wrote: Sun Sep 10, 2023 9:42 pm What's interesting is the 209MB EFI volume thats formatted FAT32. I guess that's a standard thing. I'm pretty sure I reformatted that drive when I bought it to APFS... and you can see the Sample Libraries volume underneath the EFI volume that is indeed APFS format.
Yeah that's a standard thing, I asked Western Digital about why the NVME USB3.3 Sandisk doesn't support SMART, and they suggested upgrading the EFI firmware using a PC, because it's a FAT32 file. There was some run that had issues, but that wasn't my problem at all.

USB3 on Mac OS doesn't support SMART to NVME drives. So IMO getting an NVME Sandisk like I have is a bad idea.

USB4 is great, so far no issues with the NVME in an USB4 enclosure at all.

Re: Don't forget the Trim!

Posted: Tue Sep 12, 2023 12:44 pm
by Phil O
Hey thanks for the reminder. I forgot to do that when I got my Mini. The externals were running without Trim enabled.

Your friendly neighborhood Phil