1

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.

1 Answers1

0

Best guess is that the drives are pulling too much power and the host computer or the USB controller in the drive is limiting current draw to protect everything from an overcurrent condition. If the drives only have USB for power then that makes this far more likely. If there is an option to power the drives from an external power supply then I suggest taking it. If you have a powered USB hub then plugging the devices into the hub can resolve this too. Not all USB ports are equal, even when on the same computer, so moving the devices around can resolve this.

Do you know how much current the devices draw? Are they USB 2.0 or USB 3.x devices? Are the ports on the host USB 2.0 or USB 3.x?

A big clue to this being a power problem is that the drives react when plugging in another device. Just because the drives don't disconnect at the same time doesn't mean this isn't a power problem. There is a voltage drop over cables and this is dependent on current draw. Drives, especially those with spinning platters, will have variable current draw. The voltage will drop at the port when you plug in something that draws power, and drop more at the drives because of loss through the USB cable, the voltage could drop enough to make the circuits think they were unplugged. Once the drives stop spinning and heads stop seeking then current drops, voltage is back to where it should be, and the drive thinks it was plugged back in.

A USB 2.0 port is required to supply 500 mA. A USB 2.0 device is allowed to draw up to 1.5 amps, but only after the device requests more power and the request is granted by the host. Some USB 2.0 ports will provide as much as 2.4 amps by using the option to comply with the USB-PD spec.

A USB 3.x port is required to provide 900 mA, often provides 1.5 amps for USB 2.0 compatibility, and can supply up to 3 amps for high power USB 3.x and low power USB-PD devices.

Use the numbers I give as a place to start on checking if there is a power problem. Check the USB devices for how much current they draw. See if there is a power output listed for the USB ports on the computer. It's probably safe to assume any given port can provide 1.5 amps if you can't find anything to say otherwise. This 1.5 amp budget might be shared among more than one port so two high current draw devices on adjacent ports can produce a power problem.

MacGuffin
  • 417