2017年2月10日金曜日

Western Digital製HDDのIntelliParkの設定

HDDのSMART情報の「Load_Cycle_Count 」の値の上昇が激しい。この値は、Western DigitalのHDDの場合IntelliParkという機能の動作回数を示すようだ。

IntelliParkという機能は、HDDのアイドル時(一定時間アクセスがない)に自動的に記録ヘッドを退避させて空気抵抗を減らし、読み取り/書き込みチャンネルのエレクトロニクスを停止し、低消費電力を実現するものらしい。低消費電力は歓迎(と言っても2.5インチHDDの消費電力なんてたかが知れているのに、この機能でどれだけ消費電力が減るのかという疑問もあるが)だが、8秒間という設定値(8秒間アクセスがなければ記録ヘッド退避)もおかしい(短すぎる)し、メーカーの保証値もたった30万回程度というのも少なすぎでしょう。こんな設定値ではすぐ保障の上限回数に達してしまう。そこでこの設定値を変更することにした。

smartctlコマンドで読みだした「Load_Cycle_Count 」の値は以下の通り。

193 Load_Cycle_Count        0x0032   108   108   000    Old_age   Always       -       277343

約2カ月前に調べたSMART情報と比べて、約3万の増加。これではあと数か月で、メーカーの保証値30万回を突破してしまう。

Linux上でIntelliParkの設定の変更には、「idle3-tools」というツールがあるようだ。

http://idle3-tools.sourceforge.net/

CentOS7のyumでインストールできるパッケージは用意されていないようなので、ソールコードをダウンロードしてコンパイルして利用する。

先ずは、ソースコードをダウンロードして解凍。

$ wget https://sourceforge.net/projects/idle3-tools/files/idle3-tools-0.9.1.tgz/download
$ tar xzvf idle3-tools-0.9.1.tgz
idle3-tools-0.9.1/
idle3-tools-0.9.1/COPYING
idle3-tools-0.9.1/idle3ctl.8
idle3-tools-0.9.1/Makefile
idle3-tools-0.9.1/sgio.c
idle3-tools-0.9.1/idle3ctl.c
idle3-tools-0.9.1/sgio.h

次にコンパイル。

$ cd idle3-tools-0.9.1
$ make
cc -g -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs    -c -o idle3ctl.o idle3ctl.c
idle3ctl.c:47:5: 警告: 関数宣言がプロトタイプではありません [-Wstrict-prototypes]
 int check_WDC_drive()
     ^
idle3ctl.c:88:5: 警告: 関数宣言がプロトタイプではありません [-Wstrict-prototypes]
 int VSC_enable()
     ^
idle3ctl.c:112:5: 警告: 関数宣言がプロトタイプではありません [-Wstrict-prototypes]
 int VSC_disable()
     ^
idle3ctl.c:136:5: 警告: 前に ‘VSC_send_key’ 用のプロトタイプがありません [-Wmissing-prototypes]
 int VSC_send_key(char rw)
     ^
idle3ctl.c:166:5: 警告: 関数宣言がプロトタイプではありません [-Wstrict-prototypes]
 int VSC_send_write_key()
     ^
idle3ctl.c:173:5: 警告: 関数宣言がプロトタイプではありません [-Wstrict-prototypes]
 int VSC_send_read_key()
     ^
idle3ctl.c:182:5: 警告: 前に ‘VSC_get_timer’ 用のプロトタイプがありません [-Wmissing-prototypes]
 int VSC_get_timer(unsigned char *timer)
     ^
idle3ctl.c:213:5: 警告: 前に ‘VSC_set_timer’ 用のプロトタイプがありません [-Wmissing-prototypes]
 int VSC_set_timer(unsigned char timer)
     ^
idle3ctl.c:244:6: 警告: 前に ‘cleanup’ 用のプロトタイプがありません [-Wmissing-prototypes]
 void cleanup(void)
      ^
idle3ctl.c:252:6: 警告: 前に ‘show_version’ 用のプロトタイプがありません [-Wmissing-prototypes]
 void show_version(void)
      ^
idle3ctl.c:258:6: 警告: 前に ‘show_usage’ 用のプロトタイプがありません [-Wmissing-prototypes]
 void show_usage(void)
      ^
cc -g -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs    -c -o sgio.o sgio.c
cc -s -o idle3ctl idle3ctl.o sgio.o
#strip idle3ctl

コンパイル時に警告が出まくったけど、問題はなさそう。

どうせ今回しか使わないのでこの場所に置いたまま直接実行することにする。

プログラムを実行し、現在のIntelliParkの設定値を表示させて確認。

$ sudo ./idle3ctl -g /dev/sda
Idle3 timer set to 80 (0x50)

8秒ということですね。メーカーの規定値のままです。

IntelliParkの機能をdisable(無効)に設定する。

$ sudo ./idle3ctl -d /dev/sda
Idle3 timer disabled
Please power cycle your drive off and on for the new setting to be taken into account. A reboot will not be enough!

電源を入れ直すと新しい設定が有効になるようだ。リブートでは、not be enough!。

ということで、電源を入れ直してIntelliParkの設定確認。

$ sudo ./idle3ctl -g /dev/sda
Idle3 timer is disabled

IntelliParkの機能をdisable(無効)に設定できました。

idle3ctlコマンドの指定方法は以下の通り。

idle3ctl [options] /dev/device

-h : display help
-l : show license and exit immediately
-V : show version and exit immediately
-v : verbose output
--force : force even if no Western Digital HDD are detected
-g : get raw idle3 timer value (default action)
-g100 : get idle3 timer value as wdidle3 v1.00 would display it
-g103 : get idle3 timer value as wdidle3 v1.03/v1.05 would display it
-d : disable idle3 timer
-s : set idle3 timer raw value (1-255)

0 件のコメント:

コメントを投稿