# External USB drives unmount after awhile

## grant123

My external USD SSD and HD drives automatically unmount themselves after awhile.  What causes this?

----------

## depontius

I've had similar issues with an eSATA drive.  But after I put it into "production" I had both swap and OpenAFS cache on that drive, and the disconnections stopped.

I suspect it's some sort of inactivity auto-disconnect, and moving something with constant activity onto the drive meant that it was never inactive for long.  You could test this with some sort of script that would keep checking a file on the external drive every so often in a sleep loop.  It's even possible/probably that somewhere in the source code or /proc or /sys there's a well-known location to adjust this behavior.

----------

## grant123

I agree, it is most likely an inactivity disconnect.  Surely there's a way to adjust this behavior?

----------

## depontius

I'm sure there is a right way to fix this, but the workaround is to just generate "sufficiently frequent" activity.  In my case, I suspect that placing the afs cache on the removable drive did the trick.  I don't know if there is guaranteed activity to swap that would do the same thing.  There tends to be some afs chatter as it talks to the servers and updates cache status.

----------

## grant123

OK, if anyone knows the "right" way to fix this, please let us know.

----------

## eccerr0r

Most of my spontaneous disconnects were due to bad hardware, so don't rule this out.

My "good" USB hardware doesn't spontaneously disconnect...

What hardware?  Good cables?  Good connectors?

----------

## grant123

It's a Transcend USB3 256GB SSD with its own cable plugged into one of the USB ports on my Dell XPS 13 laptop.  I have two external HDs that also disconnect a lot but they could be damaged as they've traveled with me a lot.

----------

## Roman_Gruber

Well when I hear laptop and travel a lot: Most connectors on the mainboards are cheap. 

I overused the connectors on my previous notebooks, they get worn out and cause random failures on cheap usb sticks for example.

Also cables tend to do the same, e.g. 2 damaged esata cables when hardly used.

Sounds to me like a worn out connector of your mainboard of the notebook.

3rd the firmware of the external drive may cause this too, or a setting of this firmware.

try a fresh cable, try on a different port of your notebook and to absoletly verify try on another computer with hardly used usb connector..

----------

## depontius

In my case mentioned above, it was a brand-new esata cable and case, never-used esata port on a port replicator.  Initially it appears that the connection would time out and the drive disappear.  Once I moved swap and the afs cache to that drive, it worked reliably.  Same hardware, two different usage cases.

----------

## grant123

For me, the cable is pretty new, but the drive hasn't unmounted itself in several days which I think does point to a hardware problem somewhere.

----------

