Sujet : Re: F2FS On USB Sticks?
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : comp.os.linux.miscDate : 21. Mar 2025, 20:01:54
Autres entêtes
Organisation : A little, after lunch
Message-ID : <vrkd32$257qv$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 21/03/2025 07:13, c186282 wrote:
On 3/20/25 11:04 PM, Lawrence D'Oliveiro wrote:
I was under the impression that all devices using flash memory had some
kind of wear-levelling logic built into their controllers. But now I hear
that the level of sophistication of this varies. Namely, while SSDs, meant
for running OS installations and active user filesystems, put the most
effort into prolonging their lives, SD cards and USB sticks do not.
>
So it makes sense to use some more flash-aware filesystem on the latter
devices, to help reduce the wear on them as well. Looking at the Wikipedia
list <https://en.wikipedia.org/wiki/Flash_file_system>, it seems like F2FS
is the best bet.
>
Anybody tried this sort of thing?
Gparted has F2FS as a formatting option ...
I think you are chasing Unicorns here.
SD cards and thumb drives are designed as limited usage cheap storage, and no amount of faffing around with filesystems is going to change that. At some stage no matter what file system is in operation data needs to be (over) written and blocks need to be erased to do it.
Professional level SSDs are designed to adapt the writes to extract the best out of a limited block erase life, and that's that, and you pay for that by using a more conservative memory cell design and hanging a lot of smarts in front of it.
Since there is no 1:1 correlation between the sector you think you are writing to, and the actual physical RAM on even a thumbdrive, there is nothing you can do at the operating system level other than caching your writes and doing them in single big chunks in the hope that some of them end up in the same erase page, and using the DISCARD function.
If you want better life, buy a better SSD. And a much bigger one than you need. If you are reading and writing 100Mbytre of data regularly, using 100Gbyte drive will lessen the erase stress on each block by 1000.
And if you must use an SDcard or thumb drive, do what I did. Take your linux and move everything that doesn't need to be persistent, like most logging, and any temporary files onto a ram drive. And turn off swap.
You can monitor I/O. It should be zero IO onto the SD card
If you have so much moving data that it overflows the ram or needs to persist between reboots, use a pukka SSD.
-- "And if the blind lead the blind, both shall fall into the ditch".Gospel of St. Mathew 15:14