Hi Mai Kee,
it is the script I use on my QNAP TS-109, which has its disk(s) attached
via SATA, so for the NSLU2 you would just replace hdparm with scsi-stop.
I am not 100% sure what you mean with "in-que-read/
The parameters from /sys/block/$
number of completed reads and writes
(see /usr/src/linux/
actually simplify this by just watching for _any_ change
in /sys/block/$
of the script (untested!):
#!/bin/sh
DEV=sdb
TIMEOUTMIN=10
TICKSEC=10
let "CYCLES=$TIMEOUTMIN
state=active
stat=""
count=0
while true ; do
stat_old=$stat
stat=`cat /sys/block/$
if [ "$stat" != "$stat_old" ] ; then
# disk activity detected
count=0
state=active
else
[ "$state" = "active" ] && let count++
fi
if [ "$state" = "active" -a $count -gt $CYCLES ] ; then
# spin down
/opt/sbin/scsi-
state=standby
fi
sleep $TICKSEC
done
Regarding samba, you could watch the client and/or "Locked files"
entries returned by the tool 'smbstatus' and only spin down the disk if
there are no such entries (if that's the behavior you desire). However I
am not that familiar with samba, so this might not cover all your use
cases...
Best regards,
-Thomas
Am Mittwoch, den 23.09.2009, 23:17 +0200 schrieb Mai Kee Reis:
> Hi Thomas,
>
> your script helps a lot, I think!
> Need to learn sh syntax again ;-) but i like it.
> Some small questions:
> Do you know what rmtab counterpart for SAMBA is?
> Did I understand right, you don't evaluate the in-que-read/
> why can you use hdparm? AFAIK, the slug has no IDE port, and hdparm does
> not work via USB, as I read here:
> <http://www.nslu2-
>
> with regards & respect,
> Mai Kee
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
No comments:
Post a Comment