The title says it all.
My old (>10y) old box passed away, and since external storage devices have become really big and cheap, I decided to put my data to two of those.
Yes, they might be slower but I wouldn't use that for heavy traffic applications anyway, and on next moving day I will simply plug the storage to a new box.
It worked perfectly for a few months, but now the devices are disconnecting (unmounted) for no apparent reason about once in a week, then reconnect by themselves or need to be re-plugged.
And they disconnect independent of each other, so I don't think it is a duplicate of USB devices disconnecting / touchpad turns off. USB-mouse and keyboard look unaffected, or maybe they reconnect fast enough that I don't notice.
The box runs Ubuntu 18.04.04.
What could be the reason, and how can I avoid this nuisance?
Edit: just now it happened again.
When plugging in my android device for development/debugging the external disk audibly shut down and reconnected (you might now the clicking sound).
Programs with open files on the external device failed to read from it, even when the notification said it was connected "just now".
I'm really concerned this misbehavior can damage my storage device and cause permanent data loss.
Edit2:
at some time in the past, this feature caused an encrypted hsqldb storage to be lost as some blocks needed for the encryption were not written when the system disconnected the storage device.