Re: [nslu2-linux] scsi-stop and cron-job?
- 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/write operations".
The parameters from /sys/block/$DEV/stat used in the script are the
number of completed reads and writes
(see /usr/src/linux/Documentation/iostats.txt). However you could
actually simplify this by just watching for _any_ change
in /sys/block/$DEV/stat, as shown in the following stripped down version
of the script (untested!):
while true ; do
if [ "$stat" != "$stat_old" ] ; then
# disk activity detected
[ "$state" = "active" ] && let count++
if [ "$state" = "active" -a $count -gt $CYCLES ] ; then
# spin down
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
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/write operations?
> why can you use hdparm? AFAIK, the slug has no IDE port, and hdparm does
> not work via USB, as I read here:
> with regards & respect,
> Mai Kee