I have an external hard drive in a SATA/USB 3.0 enclosure. It usually works fine, but if I plug it in my Windows 10 laptop for too long, it briefly disconnects after some time. It's not mounted anymore and any read/write operation that was underway shows an error message (usually something like "Drive not found") and stops. Any explorer window that was showing its content closes.
If I then open explorer or type list disk
in diskpart, the drive will show as if I had just plugged it in: it won't be selected anymore in diskpart for example. I can start over any operation that was underway when it disconnected, but the same thing will happen eventually.
This prevents me from doing anything too long, like erasing the drive with diskpart's clean all
feature (I've tried 5 times already, the operation always stops after a few dozens minutes).
I thought about a Windows power-saving feature killing my drive after a bit, but my laptop is charging and in "High performance" power mode. Furthermore, it would be weird for such feature to kill a drive that's in use.
Why is my drive disconnecting after some time, even in use ? How can I prevent that ?