[SOLVED] Pendrive Vs. SSD: wear-leveling and cache?

MandelaEffect2000

Reputable
Apr 6, 2017
53
1
4,535
Hello!

So I've managed to install Windows 10 on a SSD running entirely off of USB3.0.

Therefore, my question is with regards to performance between SSD Vs. Pendrive.

For example, do USB3.0 Pendrives also have internal cache? Also, does the firmware also have wear-leveling algorithms to reduce wear on the flash memory like SSD's?

Thank you!
 
Solution
Does that mean that SSD's or anything containing NAND cells do not need defragmentation?
It's not the fact of NAND cells.
Rather...the SSD firmware shuffles data around as it sees fit. This is the wear leveling.

Windows and other modern OS's know the difference between an SSD and HDD, and treats them accordingly.
The user does not have to invoke a defrag routine manually, nor should they.

Defrag on an HDD is needed, because data is stored in actual physical locations. As time goes on, parts of a particular "file" may reside in multiple locations on the platter.
A defrag attempts to put them all in one contiguous space, for faster reading.

MasterMadBones

Distinguished
I never trust pendrives. They seem to always die on me. However - there is definitely some wear leveling going on in pendrives, the quality of which is often reflected in their price. Larger drives seem to last longer as well.

When I want to run a portable OS on a thumbdrive, I usually pick a Linux distro and use ext2 instead of ext4 to reduce the amount of writing the drive's flash.
 

MandelaEffect2000

Reputable
Apr 6, 2017
53
1
4,535
Question - How is the actual performance vs a regular internal SSD?
What?

To your question...the controller in typical flash drives is not as sophisticated as that which you'd find in a real SSD.
This include TRIM, cache, etc.

Additionally, the OS treats them differently.
Good point, but what is TRIM? And how does the OS treat them differently?

For example, I'm running a portable OS on a SSD via USB3.0 using a docking station. Speeds are quite good, if not equal to running this same SSD via SATA-3.

I never trust pendrives. They seem to always die on me. However - there is definitely some wear leveling going on in pendrives, the quality of which is often reflected in their price. Larger drives seem to last longer as well.

When I want to run a portable OS on a thumbdrive, I usually pick a Linux distro and use ext2 instead of ext4 to reduce the amount of writing the drive's flash.
Thanks. Can you tell us models and brands that you have had a bad experience? I'm seriously thinking about buying one to run Linux too! Lubuntu seems to be the most appropriate because it's lightweight.

Why ext2 Vs. ext4 reduces the amount of writes? Is it because of logging or something?
 

USAFRet

Titan
Moderator
Running the actual OS. How is the actual performance?
Does it feel different, running via USB on a flash drive, vs an internally connected SSD?

Good point, but what is TRIM? And how does the OS treat them differently?
TRIM is a function that does garbage cleanup on the drive in the background. This has major impact on drive lifespan. Associated with wear leveling.
That may not be available via a USB connection.
 

MandelaEffect2000

Reputable
Apr 6, 2017
53
1
4,535
Running the actual OS. How is the actual performance?
Does it feel different, running via USB on a flash drive, vs an internally connected SSD?
I have a screenshot of CrystalDiskMark benchmark results for this SSD which is a five-year-old OCZ Vertex 3 (SATA-3) via USB.

Overall in terms of actual OS performance, it feels pretty good. It's running Windows 10 Pro which is quite heavy compared to most Linux distributions (in fact it's running a bit faster than Ubuntu 20.04 LTS which I also tried via USB). Initially I thought this wouldn't work but to my surprise all hardware drivers are installed including the OEM license (Windows 10 is activated). The only baseline for comparison is the Windows 10 Pro performance on a 2.5" 7200RPM 1TB HDD which is currently what I have, and it feels much faster of course. But I used to have this OCZ SSD running with a AMD FX8350/ASUS Sabertooth 990FX Gen2 R2.0, and this mobo had SATA-3 ports. Performance is nearly identical on Windows and Ubuntu. I don't have this mobo anymore to compare benchmark values, but I'm pretty sure the results were practically the same.



TRIM is a function that does garbage cleanup on the drive in the background. This has major impact on drive lifespan. Associated with wear leveling.
That may not be available via a USB connection.
Thanks. Do you know if there is a way to check if TRIM is enabled?

I've done a bit of reading and thought there were only two types of wear-leveling strategies, Dynamic Vs. Static. Will read about TRIM as well.
 

USAFRet

Titan
Moderator
Running a Windows install via USB can be done.
But without a real need, why?

Your CrystalDiskMark on the right, mine on the left:
(and mine is a 6 year old Samsung 250GB 840 EVO)
vSwYu9D.png

You're leaving a LOT of SSD performance on the table.
 

MandelaEffect2000

Reputable
Apr 6, 2017
53
1
4,535
Running a Windows install via USB can be done.
But without a real need, why?

Your CrystalDiskMark on the right, mine on the left:
(and mine is a 6 year old Samsung 250GB 840 EVO)
vSwYu9D.png

You're leaving a LOT of SSD performance on the table.
Yes, it's a spare drive now. Also, I used to format this SSD a lot back when I was using it as my primary drive. At the time I didn't know about wear-leveling and that the number of writes on it would decrease performance and its lifespan.

As to the need, it's always nice to have a completely portable operating system separate from your main operating system. If you mess up badly, your primary system won't be affected. It's for testing purposes.

So, do you know of a way to test whether TRIM is enabled or not?
 
Yes, it's a spare drive now. Also, I used to format this SSD a lot back when I was using it as my primary drive. At the time I didn't know about wear-leveling and that the number of writes on it would decrease performance and its lifespan.

As to the need, it's always nice to have a completely portable operating system separate from your main operating system. If you mess up badly, your primary system won't be affected. It's for testing purposes.

So, do you know of a way to test whether TRIM is enabled or not?
If the ssd is connected via sata use the trim check that usafret showed.
If the ssd is connected via usb some reading.
http://salutepc.altervista.org/ssd-on-usb-3-0-3-1-with-trim-support-windows-linux.html
 
  • Like
Reactions: MandelaEffect2000

USAFRet

Titan
Moderator
Logging and automatic degragmentation. Ext4 likes to move larger files to the middle of the partition to reduce fragmentation early on. I don't know exactly how it behaves or if it's any different on flash media.
Partitions on solid state media are completely different than on spinning drives.

On a typical HDD, partitions are actual physical spaces.

On an SSD, the 'partitions' are merely logical representations, shown to the user in the typical standard format.
The drive firmware shuffles data around between all of the cells as it sees fit, to even out the actual usage. This is wear leveling.
The user and OS has no idea what actual physical "cells" a particular bit of data resides on. Or where it resided 5 minutes ago, or will reside 10 minutes from now.
 

MandelaEffect2000

Reputable
Apr 6, 2017
53
1
4,535
Logging and automatic defragmentation. Ext4 likes to move larger files to the middle of the partition to reduce fragmentation early on. I don't know exactly how it behaves or if it's any different on flash media.
Thanks for the information. But isn't Ext partitions actually fragmentation free?

IIRC, not needing to defrag Ext partitions was one of the biggest advantages over NTFS filesystem.

Partitions on solid state media are completely different than on spinning drives.

On a typical HDD, partitions are actual physical spaces.

On an SSD, the 'partitions' are merely logical representations, shown to the user in the typical standard format.
The drive firmware shuffles data around between all of the cells as it sees fit, to even out the actual usage. This is wear leveling.
The user and OS has no idea what actual physical "cells" a particular bit of data resides on. Or where it resided 5 minutes ago, or will reside 10 minutes from now.
Does that mean that SSD's or anything containing NAND cells do not need defragmentation?
 

USAFRet

Titan
Moderator
Does that mean that SSD's or anything containing NAND cells do not need defragmentation?
It's not the fact of NAND cells.
Rather...the SSD firmware shuffles data around as it sees fit. This is the wear leveling.

Windows and other modern OS's know the difference between an SSD and HDD, and treats them accordingly.
The user does not have to invoke a defrag routine manually, nor should they.

Defrag on an HDD is needed, because data is stored in actual physical locations. As time goes on, parts of a particular "file" may reside in multiple locations on the platter.
A defrag attempts to put them all in one contiguous space, for faster reading.
 
Solution

MandelaEffect2000

Reputable
Apr 6, 2017
53
1
4,535
Thanks USAFRet for the clarifications!

Now can anybody confirm whether Ext4 filesystem really need defragmentation if running on a mechanical hard drive?

Logging and automatic defragmentation. Ext4 likes to move larger files to the middle of the partition to reduce fragmentation early on. I don't know exactly how it behaves or if it's any different on flash media.
 

USAFRet

Titan
Moderator
Now can anybody confirm whether Ext4 filesystem really need defragmentation if running on a mechanical hard drive?
https://superuser.com/questions/536788/do-ext4-filesystems-need-to-be-defragmented

https://askubuntu.com/questions/221079/how-to-defrag-an-ext4-filesystem

https://opensource.com/article/17/5/introduction-ext4-filesystem
"Linux's extended filesystems use data-allocation strategies that help to minimize fragmentation of files on the hard drive and reduce the effects of fragmentation when it does occur. "
 

MasterMadBones

Distinguished
I remember commenting on this thread, but it seems that I may have forgotten to actually post it. To clarify, the strategies that ext4 uses do increase the write load, although obviously not as much as retroactively defragging files, like you would need to do with NTFS.

The question then is whether ext4 is SSD-aware, which is somethin I donlt know and why I usually prefer to stick with simpler filesystems on USB flash drives and SD cards.