Это скрипт для старого ядра. Для 2.6 тут http://wl500g.info/showpost.php?p=203696&postcount=173.Code:#!/bin/sh if /usr/bin/[ $# -ne 1 ]; then /bin/echo 1>&2 "Usage: $0 <device>" /bin/echo 1>&2 "example: $0 sda" exit 1 fi #Check every 30 seconds for disk io changes PERIOD=30 #if no changes are found during 5 minutes -> disk spindown BOUNDARY=300 SCSISTOP=/usr/sbin/scsi-stop LOGFILE=/tmp/scsi-$1.log str=`/bin/grep $1 /proc/diskstats` cooltime=0 stopped=0 while /bin/true; do /bin/sleep $PERIOD newstr=`/bin/grep $1 /proc/diskstats` if /usr/bin/[ "$newstr" = "$str" ]; then cooltime=$(($cooltime + $PERIOD)) if /usr/bin/[ $cooltime -ge $BOUNDARY -a $stopped -eq 0 ]; then $SCSISTOP /dev/$1 time=`/bin/date '+%b %e %H:%M:%S'` /bin/echo "$time: Cooled down..." >> $LOGFILE stopped=1 fi else if /usr/bin/[ $cooltime -ne 0 ]; then time=`/bin/date '+%b %e %H:%M:%S'` /bin/echo "$time: Disk first used after $cooltime seconds" >> $LOGFILE fi cooltime=0 str=$newstr stopped=0 fi done