13

I am able to spindown my SATA HDDs by using

sudo hdparm -y /dev/sdc

The state shown by

sudo hdparm -C /dev/sdc

changes from active/idle to standby (and I can hear the HDD spin down).

However, using

sudo hdparm -S5 /dev/sdc

doesn't spin down the drive after 5*5 = 25secs.

Some additional information:

  • AHCI is enabled.
  • I am using Western Digital Green drives.
  • APM_level = not supported
  • Filesystem is ext4

Edit: This question is not a duplicate to How can I control HDD spin down time? because it addresses Western Digital Green drives, which will not work with hdparm.

2
  • 1
    You may need to set Advanced Power Management to something lower then 128 first, as high values (128-254) do not allow spin-down. Try sudo hdparm -B 127 /dev/sdc. Oct 4 '12 at 18:55
  • hdparm -B doesn't work, because APM_level = not supported on the HDDs. Oct 5 '12 at 2:40
13

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]
4
  • 1
    WD30EZRS and WD30EZRX are also affected. Sep 16 '13 at 20:50
  • 1
    Thanks: this might explain why I can only stop my daft WD from constantly going on/off standby - and thus accruing load cycles dangerously quickly towards the mfg threshold of 300000 - by disabling both APM and WDidle. Neither is effective alone. I disabled -Standby for good measure, though I'm not sure it matters once the others are off. The HD claims to support APM, but settings > 128 don't disable standby as claimed, so it exhibits the cycling problem. This is a "Blue" model as follows: "Model Family: Western Digital Scorpio Blue Serial ATA (AF) Device Model: WDC WD3200BPVT-22JJ5T0" Sep 2 '15 at 21:33
  • on debian buster i had to apt install apparmor-utils as well. use sudo aa-disable /etc/apparmor.d/usr.bin.man before and sudo aa-enforce /etc/apparmor.d/usr.bin.man after invoking dpkg-buildpackage
    – bernstein
    Feb 6 at 0:12
  • afaik this helps with all scorpio (e.g. WD 2.5" end user) hdds
    – bernstein
    Feb 7 at 20:32
0

The ubuntu way seems to be the laptop mode*

How to:

apt-get install laptop-mode-tools

Afterwards you are able to configure individual power/standby settings through

vim /etc/hdparm.conf

And check your current laptop mode state with:

cat /proc/sys/vm/laptop_mode

If you want to know more:

1
  • 1
    This won't work for Western Digital Green drives. Apr 16 '14 at 9:11

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