|
LS220Dのファン回転数制御
HDDの温度をもっと下げたいのだが・・・
LS220DはHDD 2bayのNASなので、シングルbayのLS210Dとは違って排熱ファンが1機付いており、CPUと HDDの温度を監視して温度が高くなり過ぎないよう回転数を制御している。ファン制御のdaemonはブート時に "/etc/init.d/fanctld.sh" から呼び出され、実際に動作している daemon は "/usr/local/sbin/fanctld_nopwm.sh"というスクリプトだ。
# ps -efa | grep fan
4115 root {fanctld_nopwm.s} /bin/bash /usr/local/sbin/fanctld_nopwm.sh
|
CPU, HDDの温度とファン回転数の設定は "/etc/fanctld.conf"ファイルに以下のように記述されていた。
temp0.output=cpu
temp1.output=smart
threshold.hdd_stop.min=0
threshold.hdd_stop.max=10
threshold.cpu_stop.min=0
threshold.cpu_stop.max=20
threshold.hdd_low.min=11
threshold.hdd_low.max=12
threshold.cpu_low.min=21
threshold.cpu_low.max=22
threshold.hdd_norm.min=54
threshold.hdd_norm.max=54
threshold.cpu_norm.min=79
threshold.cpu_norm.max=79
threshold.hdd_full.min=55
threshold.hdd_full.max=60
threshold.cpu_full.min=80
threshold.cpu_full.max=85
threshold.lim.min=74
threshold.lim.max=100
|
これを見ると HDDの温度については
| 0〜10℃ | 停止(stop) |
| 11〜12℃ | 低速(low) |
| 13〜53℃ | CPUの温度次第? |
| 54℃ | 通常(norm) |
| 55℃〜 | 最高速(full) |
と言った感じのように読めて、54℃までは許容するが、それを超えたら全力で冷やすぞってところだろうか?
そして"/usr/local/sbin/fanctld_nopwm.sh" によると、ファンの回転数を変更するには "/proc/buffalo/gpio/fan/control" に stop, slow, fast, full
の何れかを書き込むことで行っているようだ。
"/etc/fanctld.conf"設定との関係は、
/etc/fanctld.conf | → /proc/buffalo/gpio/fan/control |
| 0〜10℃ | 停止(stop) | → stop |
| 11〜12℃ | 低速(low) | → slow |
| 54℃ | 通常(norm) | → fast |
| 55℃〜 | 最高(full) | → full |
となるようだ。なのだけど、以下のように実験してみたが、"/proc/buffalo/gpio/fan/control"に書き込んだのにうまく反映されていない感もあって自信なし。
# cat /proc/buffalo/gpio/fan/control
slow
# echo slow > /proc/buffalo/gpio/fan/control
# cat /proc/buffalo/gpio/fan/control
fast
# echo fast > /proc/buffalo/gpio/fan/control
# cat /proc/buffalo/gpio/fan/control
slow
# echo full > /proc/buffalo/gpio/fan/control
# cat /proc/buffalo/gpio/fan/control
stop
# echo stop > /proc/buffalo/gpio/fan/control
# cat /proc/buffalo/gpio/fan/control
full
|
しかし、ファン音を聞いた感じ回転数は変わっているようなので、まぁヨシとしよう。
個人的には HDD の温度は40℃前後で安定しているのが好ましいと考えているので、もっと低い温度(30℃台)からファンの回転数を上げて欲しいところだ。と思って "/etc/fanctld.conf"ファイル
を修正してみたりしたのだが、これは全く無意味だった。と言うのも、この辺りのファイルはいくら編集、修正しても LS220D を再起動すると元に戻ってしまうのだ。おそらくブート時にファームウェアから解凍・展開されているのだろう。
どうすれば自分の好みの設定でファンの回転数を制御することができるだろうか?色々と試行錯誤した結果、以下のようにしてみた。
- 自分用のファン設定ファイル
"/etc/my_fanctld.conf" を作成
"/etc/fanctld.conf"ファイルを元に、自分好みの設定を記述した "/etc/my_fanctld.conf"を作成する。
# cp /etc/fanctld.conf /etc/my_fanctld.conf
# vi /etc/my_fanctld.conf
|
40℃前後で安定させたいと考えた設定が以下。
temp0.output=cpu
temp1.output=smart
threshold.hdd_stop.min=0
threshold.hdd_stop.max=10
threshold.cpu_stop.min=0
threshold.cpu_stop.max=20
threshold.hdd_low.min=11
threshold.hdd_low.max=22
threshold.cpu_low.min=21
threshold.cpu_low.max=22
threshold.hdd_norm.min=22
threshold.hdd_norm.max=40
threshold.cpu_norm.min=30
threshold.cpu_norm.max=40
threshold.hdd_full.min=41
threshold.hdd_full.max=60
threshold.cpu_full.min=41
threshold.cpu_full.max=85
threshold.lim.min=74
threshold.lim.max=100
|
意図としてはHDDの温度が20〜30℃台からファンの回転数を上げて行き、41℃以上で全力と言った感じ。
"/etc/init.d/fanctld.sh"を元に、先のファン設定を使った daemon を起動スクリプト "/etc/init.d/my_fanctld.sh"を作成する。
# cp /etc/init.d/fanctld.sh /etc/init.d/my_fanctld.sh
# vi /etc/init.d/my_fanctld.sh
|
#!/bin/sh
. /etc/nas_feature
if [ "$SUPPORT_FAN" != "on" ]; then
FANCTLD=/usr/local/sbin/temprature.sh
else
if [ "${SERIES_NAME}" = "LinkStation" ] ; then
FANCTLD=/usr/local/sbin/fanctld_nopwm.sh
else
FANCTLD=/usr/local/sbin/fanctld.sh
fi
fi
PIDFILE=`grep "^PIDFILE=" ${FANCTLD}|sed -e "s%.*=%%"`
trap "_exit" EXIT
_exit()
{
if [ $? != 0 ] ; then
echo " [ !! ]"
fi
}
start()
{
echo -n " * Starting my fanctld ... "
cd /
start-stop-daemon --quiet --start --background --exec $FANCTLD
[ $? != 0 ] && exit 1
echo " [ ok ]"
}
stop()
{
echo -n " * Stopping my fanctld ... "
local pid=`cat "$PIDFILE" 2>/dev/null`
local timeout=15
start-stop-daemon --quiet --stop --pidfile $PIDFILE
while [ -n "$pid" ] && `kill -9 ${pid} > /dev/null 2>/dev/null` && [ "$timeout" -ge 1 ]
do
timeout=$((${timeout} - 1))
sleep 1
done
if [ $timeout -lt 1 ]; then
echo "timeout. [ !! ]"
return 1
fi
echo " [ ok ]"
}
case $1 in
start)
stop
cp /etc/my_fanctld.conf /etc/fanctld.conf
start
;;
stop)
stop
;;
restart)
stop
cp /etc/my_fanctld.conf /etc/fanctld.conf
start
;;
*)
echo "usage: $0 {start|stop|restart}"
;;
esac
|
やっている事は何のことはない、既存の"/etc/fanctld.conf"を自分用のファン設定ファイル "/etc/my_fanctld.conf" で置き換えてから、ファン制御 daemon を起動するようにしているだけ。
- 上記の起動スクリプトがブート時に自動起動されるようにする
# cd /etc/rc.d/extensions.d
# ln -s /etc/init.d/my_fanctld.sh ./S99_my_fanctld.sh
# ln -s /etc/init.d/my_fanctld.sh ./K99_my_fanctld.sh
|
これで再起動後に自分用の設定でファン回転数が制御されるようになっているはず。
|