0

So, situation description:

  • USB 2.0 HDD Enclosure (MS-Tech LU379PS, idVendor=152d, idProduct=2336) with a WD Caviar Green 2TB inside.
  • Connected to my small Home Server (ZOTAC ZBOXSD-ID12/ID13) via USB 2.0 (not eSata, because my RAID is already connected through that port)
  • Server runs Ubuntu Server 16.04 with a minimal lubuntu desktop (no-install-recommends)
  • Edited fstab with the UUID of this drive to mount it automatically to a folder (USBBackup) in my home folder
  • Wrote a backup script that I run through cron that uses rsync to back up certain files every morning at 5:00 am to that USB drive

After a certain amount of time (it looks random, but especially after prolonged inactivity), the USB drive disconnects and won't reconnect again, which results in a failed backup.

I recently did a extended SMART test using smartmontools on the drive (outside of its enclosure), no issues. I changed the USB cable & tried different USB ports, but the problem persists.

I also have a script that runs at boot to stop automatic usb suspend

for i in /sys/bus/usb/devices/*/power/autosuspend 
do 
echo 2 > $i
done

for i in /sys/bus/usb/devices/*/power/level 
do 
echo "on" > $i 
done 

for i in /sys/bus/usb/devices/usb*/power/control 
do
echo "on" > $i
done

But nothing seems to work... Anybody else with other ideas?

1

I did a Google on "WD Caviar Green 2TB disable energy saving" and found a number of hits. It probably has to do with the WD's attempt at saving energy by parking the heads, or spinning down the drive. You might look at:

http://forums.whirlpool.net.au/archive/1367904

https://serverfault.com/questions/242891/disable-caviar-green-drives-spinning-down

which describes the use of some WD utils under Windows to set parameters in the drive, or the use of hdparm in Linux/Ubuntu to do the same...

hdparm -S 0 /dev/sda

Please do your own homework BEFORE applying ANY of these "fixes".

Cheers, Al

  • Ofcourse, also look at drive settings and not only at USB settings... So, did my homework, disabled the Idle 3 timer in my WD drive, will check on it later this week if it affected performance, also set the hdparm settings. Let's hope for the best! Otherwise it could also be the controller of my USB enclosure... – Timo Verbrugghe Jul 18 '16 at 6:53
  • Nope... did not work, USB drive just keeps on disconnecting even after disabling the Idle3 timer & set hdparm settings. So I'm now looking at the controller: JM20336 SATA->USB. Anything I can change in there? – Timo Verbrugghe Jul 23 '16 at 15:41
  • Look at usbgear.com/SCPBA.html, and note the "feature" of "Support Partial/Slumber power management". Maybe this is the problem? Does the drive work properly, without disconnecting, on another computer? Cheers, Al – heynnema Jul 23 '16 at 18:07
  • Mmm.. Yes that could be it, but that would also mean that the power management is baked into the controller of the enclosure. Yes, tested the drive multiple times outside of its enclosure. Well, I have "resolved" it using the worst possible way: writing a text file every hour to the drive (I checked in dmesg and saw the drive got disconnected after each 1,5 hour). – Timo Verbrugghe Jul 24 '16 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.