[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

custom HDD powermangement not working anymore



Hi,

I wasn't too happy with the HDD power mangement so I wrote the script below 
tailored to my needs. Basically, it looks for activity on the device and if 
there was none over the past 10 minutes it sends the disks to sleep.

Now - this worked a charm ever since I wrote it, now recently I noticed the 
keepalive script (see even further below) I use to "keep a foot in the door" 
(liek when working with gimp so the array doesn't go to sleep and has to spin 
up and has me waiting everytime I did not save in a while) does not keep the 
array alive anymore, and I can't figure why.
Command is issued, devname did not change, binaries are in place...
Pointers appreciated.


#!/bin/bash
#custom power managment KISS style

INTERVAL=600
HDPARM='/sbin/hdparm'
LOGGER='/usr/bin/logger'
ARRAY=md1

#how many transactions per second averaged over last 10min
TPS=`iostat -d $ARRAY $INTERVAL 2 | grep ^$ARRAY |tail -n1| cut -d, -f2 | 
rev | cut -d" " -f1 | rev`

if [[ $TPS -eq 0 ]]; then
# idle, going to standby
$HDPARM -y /dev/sda
$HDPARM -y /dev/sdb
$HDPARM -y /dev/sdc
$HDPARM -y /dev/sdd
$HDPARM -y /dev/sde
$HDPARM -y /dev/sdf
$LOGGER PWRWATCH sent array to standby
else
$LOGGER PWRWATCH detected activity, doing nothing
fi



-------------keepalive----------------
#!/bin/bash
#keep array spinning
while true; do
dd if=/dev/urandom of=/mnt/media/wakeup bs=1M count=100
echo -n blip...
time sync
sleep 59
done



-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--(+)@ s-:+ a C++++ UL++ P+>++ L+++>++++ E-- W++ N o? K-
w--(---) !O M+ V- PS+ PE Y++ PGP t++(---)@ 5 X+(++) R+(++) tv--(+)@ 
b++(+++) DI+++ D- G++ e* h>++ r* y?
------END GEEK CODE BLOCK------

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: