How do I make a USB-docked hard drive not "disconnect" from the connected system when idle?

I have connected a WD30EZRX WD Green HDD to a Thermaltake Blacx Duet 5G USB dock (similar linked, for example) in Ubuntu 12.04. Every thing seems fine until the HDD idles, when it seems to have cause the following error:

ls: reading directory .: Input/output error

This is only remedied by unmount and remount of the drive (typically as root). I have the following line in /etc/fstab

UUID=AAF670E9F670B6E3 /media/3TB ntfs defaults,user,auto 0 0

I have noticed that it seems to migrate between /dev/sdc2 and /dev/sdd2 devices on remount.

I did copy 1TB last night without issue in 1 sitting. But after x mins of idle it has the issue again.

Any tips/suggestions on how to proceed would be appreciated. Solutions specific to the hardware are optimal, but solutions to the larger problem are also appreciated.

Edit (tried as suggested):

root@mediaserver:/media/3TB# sudo hdparm -B 255 -S 253 /dev/sdd2

/dev/sdd2:

setting Advanced Power Management level to disabled

HDIO_DRIVE_CMD failed: Input/output error

setting standby to 253 (vendor-specific)

APM_level = not supported

Seems as if that didn't help with this particular drive.


Solution 1:

Many USB external docks will spin the drive down after a period of inactivity, regardless of how the OS directs the drive to be treated. The problem is that the drive appears to be disconnected from the system, when it really shouldn't be. There isn't really a workaround for that particular behavior. But, there is another way to deal with it. Running a keepalive script of some kind that does some form of write to the disk about every 20 seconds or so will force the drive to not spin down. This is why the transfer session you did worked OK, because the drive didn't have a chance to be spun down.

Solution 2:

Your best solution here is to get another docking station.

I have the same docking station (Thermaltake BlacX Duet 5G), and a similar problem: the drives either spin down during inactivity, or disconnect completely seemingly randomly (usually when copying a lot of files, or doing a backup – which is the basically the same). All the while, another docking station (Chieftec) worked perfectly.

I've tried changing drives, changing USB cable, changing power cable, looking for software settings to change – nothing helped. Then a dig through reviews on Amazon and NewEgg showed that there are 30–50% other customers that have the same (disconnecting HDD) problem with this docking station, and the only solution is to replace the unit.