Whenever the machine (Linux 4.4.0-38-generic, Ubuntu 16.04) suspends to RAM, my Western Digital 2TB Portable USB 3.0 hard drive (Model WDBU6Y0020BBK) will spin up and continue spinning indefinitely. Why is the drive not sent to sleep/standby mode?
Judging by the drive's LED the access on the drive (which wakes it up) happens very late in the suspend procedure: because of a small delay the drive audibly spins up even after the machine already sleeps (i.e. completed the suspend).
The storage device in question is connected to Bus 3, Port 1 (
$ lsusb | grep Western Bus 003 Device 002: ID 1058:10b8 Western Digital Technologies, Inc. Elements Portable (WDBU6Y, WDBUZG) $ lsusb -t | grep -A1 'Bus 03' /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
To shed light on the matter I used the kernel cmdline options
initcall_debug no_console_suspend ignore_loglevel dyndbg="file suspend.c +p" and Intel's AnalyzeSuspend debugging tool to collect dmesg and ftrace output. The former can be found here and the latter is rather lengthy (>340M), but contains no obvious errors:
$ grep err=[^0] mem_ftrace.txt ; echo $? 1
Moreover the problem does not seem to pertain to the driver modules since repeating the suspend resume procedure after
sudo modprobe -r uas usb_storage (which lets the drive spin down and sleep) didn't bring about any change! The drive spun up anyway.
Any pointers what to look for and/or try next?
FYI: I use a monitoring tool (hd-idle) that watches
/proc/diskstats and puts the disk to sleep (i.e. lets it spin down) after a specified amount of idle time.