Another wrapper (like mdstat), that’ll look through my Western Digital disks and fix any disk not having the head parking timeout set to a configured value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#!/bin/bash FIRMWARE_TIMEOUT_SH=138 if [ ! -x /usr/sbin/idle3ctl ] ; then echo "idle3-tools is missing." exit 1 fi for disk in /dev/sd?; do # idle time should be set to: 138 (300s) # 138-128=10 # 10x30=300 seconds FIRMWARE_TIMEOUT_IS="$( /usr/sbin/idle3ctl -g $disk | awk '{ print $5 }' )" if [ "$FIRMWARE_TIMEOUT_IS" -ne "$FIRMWARE_TIMEOUT_SH" ]; then /usr/sbin/idle3ctl -s$FIRMWARE_TIMEOUT_SH $disk fi done |