Setting SATA HDD spindown time for Western Digital Green drives

After more research, it seems that the -B and -S options of hdparm just doesn't work with certain Western Digital (and maybe other) drives.

This includes my WD10EADS, WD10EACS and WD20EARX.

I found a solution: hd-idle

To install hd-idle on Ubuntu:

wget https://downloads.sourceforge.net/project/hd-idle/hd-idle-1.04.tgz
tar xvfz hd-idle*.tgz
cd hd-idle
sudo apt-get install debhelper
sudo dpkg-buildpackage -uc -us -rfakeroot
cd ..
sudo dpkg -i hd-idle_*.deb
# To run at startup:
sudo update-rc.d hd-idle defaults
nano /etc/default/hd-idle

/etc/default/hd-idle content:

START_HD_IDLE=true
# Optional, to limit to a specific drives:
# (leading '-i 0' to disable hd-idle on other disks)
HD_IDLE_OPTS="-i 0 -a /dev/disk/by-uuid/DRIVE1UID -i 600 -a /dev/disk/by-uuid/DRIVE2UID -i 600"

Disable system-managed disk power management settings in Storage > Physical Disks > Disk properties (redundant).

sudo service hd-idle start

Check:

sudo hdparm -C /dev/sd[a-z]