How to set desktop automount options in MATE 16.04?

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?

Do the following solve your issue?
gsettings set org.mate.media-handling automount true

1 Like

Thank you for the suggestion, but I know about that option, which confusingly, contrary to the 'schema' is actually keyed under:

org.mate.desktop.media-handling.automount

Setting that option false just disables ALL automounting, moving MATE back 20 years, so you have to use Jurassic World CLI mounting from the terminal.

What is REALLY needed are options like:

org.mate.media-handling.automount.set-mode.readonly false
org.mate.media-handling.automount.set-mode.noatime true
org.mate.media-handling.automount.set-mode.relatime false
org.mate.media-handling.automount.set-mode.execute true

Implemented as follows:

Setting the "readonly" option true will cause automounted external drives to be mounted read only disabling all writes and updates (implies "noatime" since access time will also not update).

"Setting the "noatime" option true totally disables updating the "access time" file attribute on externally automounted drive filesystems to protect write limited flash media. Setting the relatime option true allows some updates to "access time" attributes when they are prior to the last "modification time", or more than 24 hours old. Setting one of "noatime" or "relatime" true will force the other option false. Setting them both false will cause updates to atime every time a file is opened for access (only reccomended for non-write-limited magnetic media).

Setting the "execute" option true automounts external media with execute permission set which allows launching linux executable files and scripts. (use with caution only on trusted media)

Maybe it's time to dump udisks2 and just have udev pass mount control directly to Caja, so Caja can launch an automount popup which will FIRST handle mount-options with checkboxes for readonly, noatime, relatime, and execute as show below:

MATE developers, take note - since the Ubuntu base distribution seems to be locked into the crippled lame inflexible "udisks2" automounting, this is a really wonderful opportunity to differentiate MATE as the go-to distro for Linux power users.

It's not like it would be all that difficult. Currently Caja has considerable code support invested in a somewhat silly Windoz inspired "media-handling" pop-up, which I am sorry to say is a feature that most serious users IMMEDIATELY DISABLE as a mildly annoying waste of time, selecting 'no action' or just launching a file browser - but pop-up per-device mount options, which would be a lot LESS work to implement, would be a HUGELY POPULAR feature.

3 Likes