PullMonkey Blog


05 Jan

USB drive disconnecting and reconnecting randomly


It was very strange, I got a new 2 TB external USB drive for Christmas and I noticed a number of windows (nautilus windows) opening up throughout the night.  So I would wake up to find 20 - 30 windows opened to the media mount directory (/media).  Overtime and watching the logs, I noticed that the new USB drive was disconnecting itself and then reconnecting.  As it would reconnect and mount, the new mount point /media/<some long character string> would pop open in a  nautilus window.  When the drive would eventually disconnect, the opened nautilus window would no longer have access to the data and would display contents from one directory up (/media).  After a couple days I finally found the answer and tried it and it worked as advertised.

For those having the same problem, this is where I found the solution you see below.

$ sudo sdparm --clear STANDBY -6 /dev/sdb
# note that your device could be something else, for example - /dev/sd<something>

And if you get an error, something like this:

change_mode_page: failed fetching page: Power condition

Then you should be able to use hdparm instead, like this:

sudo hdparm -S 0 /dev/sdb

Comments Off on USB drive disconnecting and reconnecting randomly Filed under: biking, Home, Linux, projects, tutorials Tags: , , , , , , , , ,