The microSD card used for my personal photo collection was almost full (only a few megabytes remaining) - and it failed after only a few weeks running as source photos for my screen saver, even though it should have been subject to ONLY READS.
I check this using system write tracking to the device and to my surprise found that THOUSANDS of “writes” were occurring, apparently to update each files “atime” each day.
Linux has a “noatime” mount option, but it is not the default due to the “nobrain” option being enabled on the part of the developers.
Has anyone found a convenient way to change the MORONIC udisks2 “relatime” default auto-mount option so it will stop destroying my portable flash media with needless writes?
Let me explain my strong language above - The reason I called this a “MORONIC” choice is because IT IS - and the reason I said it can DESTROY your flash media is because IT CAN.
Like many folks, I use flash media to hold thousands of small documents and image files. For example I have my entire offline web reference library on one 128G flash card, and all my personal photos on another. In the course of the day I can easily access hundreds of documents, in looking up and searching for a particular tidbit of information, while my screen saver happily cycles through THOUSANDS of photos.
So here’s the problem, thanks to some pretty stupid brainless decisions made by the kernel developers, the “relatime” option doesn’t stop all needless writes as billed, and is NOT “flash frendly”, because some fool decided to to “compromise” and implement “crappy inaccurate atime” for files, by updating the old “atime” if it is 24 hours old or more.
After all, that “atime” attribute is needed by at least two, or maybe even three crappy poorly written POSIX “apps” that pretty much NOBODY uses on removable media anyway (and that won’t work with silly only once a day “atime” updates anyway).
But surely updating the flash “atime” only once a day (even if stupid, useless, and unneeded), won’t cause a flash failure problem, will it? After all those things can be written zillions of times.
NO THEY CAN’T - the real flash endurance of modern inexpensive TLC flash devices is typically only a few hundred to a thousand program/erase cycles. Modern flash dr ives uses very large block sizes internally for block erase (typically 4MB), so even though linux is only updating a few bytes to update the useless “atime” parameter the drive could have to erase and rewrite up to 4MB of data to do it. Even with this so-called “write amplification”, we won’t necessarily have a problem for quite a while, so long as there is LOTS of empty space on the flash drive that the onboard controller can use to distribute the writes in a process called “dynamic wear leveling”.
Unfortunately, this doesn’t work very well, because unlike true SSD’s most low cost flash drives and microSD cards, can’t do “static” wear leveling to take advantage of the flash endurance of the whole drive, and to make maters worse (MUCH WORSE) if the drive has ever been reformatted, especially to a linux EXT or NTFS file system then the controller may not be able to do ANY wear leveling at all.
There are exceptions, but overall the situation is pretty bad. Quality MicroSD cards on the Raspberry Pi are one exception, since the Pi’s microSD controller can pass through trim info about which flash cells can be used for wear leveling using the hardware MicroSD “erase” command - but typical USB-MicroSD “USB Storage Device” chipsets don’t pass through this important info, other than on some very high-end USB thumb drives which use SSD controller chips with ATA extended command passthrough supporting “trim”.
. . . but for 90 plus percent of the microSD and thumbdrive flash devices out there, which support only simple dynamic wear leveling (and somtime no wear leveling at all) - lots of silly needless writes on a nearly full card (especially with a linux or ntfs file systems) is a REALLY GOOD WAY TO TRASH YOUR FLASH.
From what I have found on the web, it looks like the ONLY option is to step back TWO DECADES by disabling the udisks2 automounter garbage, and then mounting everything from the command line,
This can’t be right, so please, does anyone know of a simple way, short of manually mounting my drives every time I use them to get udisks2 to mount them properly with the “noatime” option?