Eu não tive sorte com o hd-idle; correu mas não funcionou. Acabei escrevendo o roteiro abaixo:
#!/bin/bash
# This script looks for recent disk access, and if nothing has changed, puts /dev/"drive" into spindown mode.
# This should be used only is the hdparm power management function is not working.
# Call this script with cron or manually as desired
#
#
#
# Change which drive this script looks at by changing the drive variable below:
drive="sda"
#
#
current='date'
caller=$(ps ax | grep "^ *$PPID" | awk '{print $NF}')
filename="/tmp/diskaccess.txt"
if [ -f "$filename" ]; then
stat_old='cat "$filename" | tr -dc "[:digit:]"'
stat_new='cat /sys/block/"$drive"/stat | tr -dc "[:digit:]"'
if [ "$stat_old" == "$stat_new" ]; then
stat="0"
echo "The disk hasn't been used; spinning down /dev/$drive"
echo $stat_old
hdparm -y /dev/$drive > /dev/null
else
stat="1"
echo $stat_old
echo $stat_new
echo "The drive has been used..."
echo $stat_new > $filename
fi
else
echo "/tmp/diskaccess.txt file does not exist; creating it now."
echo $stat_new > $filename
fi
echo $stat " - " $drive " - " $current " - by: " $caller >> /tmp/diskaccesslog.txt