Put HDDs in standby after X minutes using hdparm doesn't work

Solution 1:

Is AHCI enabled in your BIOS? If not try turning it on and re-trying.

If that still doesn't work, then you may have to try something a bit more complicated, as hdparm doesn't always play nicely with SATA drives, which is what I presume you have.

Check out this page for the following relatively simple solution that uses crontab:

sudo apt-get install sg3-utils
crontab -e

Now, add this to the bottom of your crontab (replace sdx with the drive you wish to put in standby):

0-59/15 * * * * ( if [ ! -f /dev/shm/1 ] ; then touch /dev/shm/1 /dev/shm/2; fi ; mv /dev/shm/1 /dev/shm/2; cat /proc/diskstats > /dev/shm/1 ) >/dev/null 2>&1
0-59/15 * * * * ( export HD="sdx "; if [ "$(diff /dev/shm/1 /dev/shm/2 | grep $HD )" =  "" ] ; then /usr/bin/sg_start --stop /dev/$HD; fi ) >/dev/null 2>&1

Of course, before attempting any of this, it's highly advisable to perform a full backup of the contents of your hard drives.

Solution 2:

Maybe a better way could be:

hdparm -B 1 -Y /dev/device
hdparm -B 255 /dev/device

The first hdparm put the device standby immediately. The second one turn off APM, so the disk stay in standby mode till the next disk access.