Do USB flash drives support TRIM? How do they wear-level if they don't?

VirtualLarry

No Lifer
Aug 25, 2001
56,570
10,202
126
And what happens when you run v-console's flash drive tester program, that writes to every block on a flash drive, and then does a read/compare operation to make sure that it's not defective. Wouldn't such an operation automatically drive the USB flash drive into a lowest-performance mode, since all pages were used by the host?
 

lsv

Golden Member
Dec 18, 2009
1,610
0
71
Probably. But most USB flash drives are already pretty slow :) A 20% dip in performance isn't going to make a difference.
 

corkyg

Elite Member | Peripherals
Super Moderator
Mar 4, 2000
27,370
239
106
Why bother? Anyway - flash drives do not support TRIM. That has to be in their firmware - something flash drives don't have a lot of. Consider them as replacements for floppies - smile and move on. :)
 

RU482

Lifer
Apr 9, 2000
12,689
3
81
to support trim, I would think you would need a more sophisticated controller than a USB flash drive would have.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,570
10,202
126
I would assume all good quality USB drives have a form or wear leveling since it is a function of the controller. Ours do.

WEAR LEVELING FAQ

"If one thinks he or she might actually try this, we suggest buying a Corsair Flash Voyager GT or a Corsair Flash Survivor GT USB drive. They are built with components guaranteed for 100,000 write cycles. With these, one can write over 210 GBytes of data to the drive each day, for ten years!"

Impressive!

Edit: That FAQ still doesn't quite answer my question. If the flash drive only implements dynamic wear leveling, then if I write to all of the blocks, in order, and don't re-use any of them, then there are no free blocks to perform dynamic wear leveling with. Without TRIM, to tell the flash drive that those blocks really aren't in use - well, I don't see how it can wear-level at that point. At that point, when you write to a block, it gets re-written, and eventually the flash drive wears out. Unless there is a small region of free blocks that is not user-accessable, but I highly doubt that, seeing as how many consumer flash drives aren't even large enough for their stated capacity, nevermind containing spare capacity.

Edit: Worse still, because of the block size differences (logical block size 512byte, physical block size 4KB or whatever), when you do an overwrite of a block, it actually has to do 8 overwrites of the same physical block, one for each logical block, wearing out your flash drive 8x faster than usual.
Edit: Physical blocks are apparently as large as 128KB. So that's 256X write-amplification for a "gridlocked" drive. So five full write passes with vconsole's flash-drive tester program could FRY an MLC-based flash drive.

I guess I'm at a quandry here. How can I tell if the flash drive is working properly, without going through and writing/verifying all blocks. But if I do that, the drive is effectively "gridlocked" without free space to perform wear-leveling, and now, it will wear out much sooner.

If USB flash drives don't support TRIM, do they support a Secure Erase?
Here's the USB flash drive tester/wiper program.
http://www.vconsole.com/client/?page=page&id=13

If you want a LOL, watch this video. Purports to show secure erasing of a flash drive. Due to wear-leveling, it doesn't actually securely delete anything. Gave me a chuckle.
http://www.youtube.com/watch?v=ZYvuqBnXNCo

I'm wiping a 32GB Microcenter-branded USB flash drive. Those drives are slow, but I think this drive is already gridlocked, because it's writing at .333MB/sec. Yes, less than 1MB/sec.

Wow, this is depressing. I can't find any reference to any Secure Erase capability for flash drives. Looks like it wasn't even part of the command protocol set. Either an oversight (unlikely, since ATA drives already have that command, and USB Mass Storage was designed after ATA storage commands), or more likely, the NSA applied some pressure to keep that command out, so forensic data-recovery of flash media was made easier.
 
Last edited:

Hacp

Lifer
Jun 8, 2005
13,923
2
81
Why would flash drives wear level? Most of your data is static anyways.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,570
10,202
126
"If one thinks he or she might actually try this, we suggest buying a Corsair Flash Voyager GT or a Corsair Flash Survivor GT USB drive. They are built with components guaranteed for 100,000 write cycles. With these, one can write over 210 GBytes of data to the drive each day, for ten years!"

These appear to not be sold anymore at Newegg. They now sell "GTR" drives. Are any of the drives currently sold on Newegg made using SLC flash? I think I'd like to pick one up, regardless of the cost.
 

Yellowbeard

Golden Member
Sep 9, 2003
1,542
2
0
Virtually nothing, if anything, is SLC these days. It's cost prohibitive. The speed is made up by using better performing controllers with MLC flash.
 

dawza

Senior member
Dec 31, 2005
921
0
76
If you can find them, the OCZ Rally 2 TURBO and ATV TURBO are SLC-based. As Yellowbeard mentioned, though, it looks like the days of SLC flash drives are over.

Logicsupply has some SLC-based CF cards and SATA and IDE flash modules, if those would serve your needs.
 

rrolsberg

Junior Member
Mar 27, 2004
5
0
0
"If one thinks he or she might actually try this, we suggest buying a Corsair Flash Voyager GT or a Corsair Flash Survivor GT USB drive. They are built with components guaranteed for 100,000 write cycles. With these, one can write over 210 GBytes of data to the drive each day, for ten years!"

Impressive!

Edit: That FAQ still doesn't quite answer my question. If the flash drive only implements dynamic wear leveling, then if I write to all of the blocks, in order, and don't re-use any of them, then there are no free blocks to perform dynamic wear leveling with. Without TRIM, to tell the flash drive that those blocks really aren't in use - well, I don't see how it can wear-level at that point. At that point, when you write to a block, it gets re-written, and eventually the flash drive wears out. Unless there is a small region of free blocks that is not user-accessable, but I highly doubt that, seeing as how many consumer flash drives aren't even large enough for their stated capacity, nevermind containing spare capacity.

Edit: Worse still, because of the block size differences (logical block size 512byte, physical block size 4KB or whatever), when you do an overwrite of a block, it actually has to do 8 overwrites of the same physical block, one for each logical block, wearing out your flash drive 8x faster than usual.
Edit: Physical blocks are apparently as large as 128KB. So that's 256X write-amplification for a "gridlocked" drive. So five full write passes with vconsole's flash-drive tester program could FRY an MLC-based flash drive.

I guess I'm at a quandry here. How can I tell if the flash drive is working properly, without going through and writing/verifying all blocks. But if I do that, the drive is effectively "gridlocked" without free space to perform wear-leveling, and now, it will wear out much sooner.

If USB flash drives don't support TRIM, do they support a Secure Erase?
Here's the USB flash drive tester/wiper program.
http://www.vconsole.com/client/?page=page&id=13

If you want a LOL, watch this video. Purports to show secure erasing of a flash drive. Due to wear-leveling, it doesn't actually securely delete anything. Gave me a chuckle.
http://www.youtube.com/watch?v=ZYvuqBnXNCo

I'm wiping a 32GB Microcenter-branded USB flash drive. Those drives are slow, but I think this drive is already gridlocked, because it's writing at .333MB/sec. Yes, less than 1MB/sec.

Wow, this is depressing. I can't find any reference to any Secure Erase capability for flash drives. Looks like it wasn't even part of the command protocol set. Either an oversight (unlikely, since ATA drives already have that command, and USB Mass Storage was designed after ATA storage commands), or more likely, the NSA applied some pressure to keep that command out, so forensic data-recovery of flash media was made easier.

Your first edit statement is spot on and from what I understand you are correct on all points. Since inexpensive USB/SDHC NAND flash devices do not support Trim, the only suggestion I can make is repartition the device and leave a major portion not partitioned (Don't forget to check and maintain the alignment). The controller should know it can use the un-partitioned area for dynamic wear leveling; however, my guess is, it will not pre-ease the NAND blocks which would improve performance but at least it will have a larger number on NAND erase blocks in the wear-leveling pool.
 

Dgkpjop

Junior Member
Oct 18, 2022
1
0
6
These appear to not be sold anymore at Newegg.
If someone does want these USB drives, Amazon sells Corsair Voyager v2, Corsair Voyager GT and Corsair Voyager GTX. Unsure if GT supports TRIM, but GTX does. I don’t have the knowledge to know if TRIM really matters as I’ve heard people argue both ways.