CentOS7(Ver:7.5)にTensorFlow(Ver:1.8.0)導入

機械学習を試してみようと思いTensorFlowを導入しようとしたが少しハマったため、記録しておく
バージョン
CentOS:7.5
TensorFlow:1.8.0
CUDA: 9.1
cuDNN:7.1.3

最初次のサイトを参考にして導入しようとしたが、CUDAのバージョンが9.0じゃないと動作しないため、ソースからインストールを行った。

CentOS7にTensorFlowをインストールする方法

ソースからインストールするのに参考にしたのは下記のサイトです。

Installing TensorFlow from Sources

実際に導入した際の手順

  1. Gitからtensorflowを得る
    $ git clone https://github.com/tensorflow/tensorflow
  2. Bazelをインストールする
    通常のリポジトリからではBazelは導入できないため、リポジトリを追加してインストールを行う

    $ wget https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo
    $ sudo mv vbatts-bazel-epel-7.repo /etc/yum.repos.d/
    $ sudo yum install bazel
  3. 手順1でダウンロードしたディレクトリに移動し、設定する
    $ cd tensorflow
    $ ./configure
    WARNING: Running Bazel server needs to be killed, because the startup options are different.
    You have bazel 0.13.0- (@non-git) installed.
    Please specify the location of python. [Default is /home/{User}/.pyenv/versions/anaconda3-5.1.0/envs/tensorflow/bin/python]: 
    
    
    Found possible Python library paths:
      /home/yuya/.pyenv/versions/anaconda3-5.1.0/envs/tensorflow/lib/python3.6/site-packages
    Please input the desired Python library path to use.  Default is [/home/{User}/.pyenv/versions/anaconda3-5.1.0/envs/tensorflow/lib/python3.6/site-packages]
    
    Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: 
    jemalloc as malloc support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: n
    No Google Cloud Platform support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: n
    No Hadoop File System support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: n
    No Amazon S3 File System support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with Apache Kafka Platform support? [Y/n]: n
    No Apache Kafka Platform support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with XLA JIT support? [y/N]: 
    No XLA JIT support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with GDR support? [y/N]: 
    No GDR support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with VERBS support? [y/N]: 
    No VERBS support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: 
    No OpenCL SYCL support will be enabled for TensorFlow.
    
    Do you wish to build TensorFlow with CUDA support? [y/N]: y
    CUDA support will be enabled for TensorFlow.
    
    Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 9.0]: 9.1
    
    
    Please specify the location where CUDA 9.1 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 
    
    
    Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7.0]: 7.1.3
    
    
    Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
    
    
    Do you wish to build TensorFlow with TensorRT support? [y/N]: 
    No TensorRT support will be enabled for TensorFlow.
    
    Please specify the NCCL version you want to use. [Leave empty to default to NCCL 1.3]: 
    
    
    Please specify a list of comma-separated Cuda compute capabilities you want to build with.
    You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
    Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 6.1]
    
    
    Do you want to use clang as CUDA compiler? [y/N]: 
    nvcc will be used as CUDA compiler.
    
    Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: 
    
    
    Do you wish to build TensorFlow with MPI support? [y/N]: 
    No MPI support will be enabled for TensorFlow.
    
    Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]: 
    
    
    Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: 
    Not configuring the WORKSPACE for Android builds.
    
    Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See tools/bazel.rc for more details.
            --config=mkl            # Build with MKL support.
            --config=monolithic     # Config for mostly static monolithic build.
    Configuration finished
  4. ビルド実施
    次のようにリンクを貼らないとエラーが起こるので次のコマンドを実行する
    $ sudo ln -s /usr/local/cuda/include/crt/math_functions.hpp /usr/local/cuda/include/math_functions.hpp
    ビルド開始

    $ bazel build --config=mkl --config=monolithic --config=cuda //tensorflow/tools/pip_package:build_pip_package
    
    (...省略... )
    
    ./tensorflow/core/kernels/cwise_ops.h(199): warning: __device__ annotation on a defaulted function("scalar_right") is ignored
    
    Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
    bazel-bin/tensorflow/tools/pip_package/build_pip_package
    INFO: Elapsed time: 2151.254s, Critical Path: 168.00s
    INFO: 5277 processes, local.
    INFO: Build completed successfully, 5387 total actions
  5. パッケージの作成
    $ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
  6. パッケージからインストール
    $ pip install /tmp/tensorflow_pkg/tensorflow-1.8.0-cp36-cp36m-linux_x86_64.whl
  7. 正常にインストールできたか確認
    $ python
    Python 3.6.4 |Anaconda, Inc.| (default, Mar 13 2018, 01:15:57) 
    [GCC 7.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import tensorflow as tf
    >>> hello = tf.constant('Hello, TensorFlow!')
    2018-05-12 21:22:39.196485: E tensorflow/core/framework/op_kernel.cc:1242] OpKernel ('op: "_MklConv2DWithBiasBackpropBias" device_type: "CPU" constraint { name: "T" allowed_values { list { type: DT_FLOAT } } } label: "MklOp"') for unknown op: _MklConv2DWithBiasBackpropBias
    >>> sess = tf.Session()
    2018-05-12 21:22:39.199427: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
    2018-05-12 21:22:39.371104: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1349] Found device 0 with properties: 
    name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.911
    pciBusID: 0000:02:00.0
    totalMemory: 7.92GiB freeMemory: 6.96GiB
    2018-05-12 21:22:39.371163: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1428] Adding visible gpu devices: 0
    2018-05-12 21:22:39.614577: I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] Device interconnect StreamExecutor with strength 1 edge matrix:
    2018-05-12 21:22:39.614618: I tensorflow/core/common_runtime/gpu/gpu_device.cc:922]      0 
    2018-05-12 21:22:39.614628: I tensorflow/core/common_runtime/gpu/gpu_device.cc:935] 0:   N 
    2018-05-12 21:22:39.614806: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1046] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6721 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:02:00.0, compute capability: 6.1)
    2018-05-12 21:22:39.690978: I tensorflow/core/common_runtime/process_util.cc:64] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
    >>> print(sess.run(hello))
    b'Hello, TensorFlow!'

以上!

Cowrie + Kippo-Graph の導入(Raspberry Pi3 Model B)

久しぶりの投稿になる。

以前から興味のあったハニーポットについて,SSHのものがあると聞き,眠っていた Paspberry Pi3 Model B を用いて構築を行った。

使用したハニーポットは Cowrie と呼ばれるもので,Kippo を改良したものである。次の投稿「SSHハニーポットはKippoではなくCowrieを使え」 に書かれているように, Kippo は攻撃者に対策が取られているようだ。Kippo のコードを編集してこの問題を訂正する方法もあるみたいだが([技術|SEC] kippoで、echoを用いたハニーポット判定を防ぐ),既に改良されたもの(Cowrie)があるので,今回は Cowrie を使用していく。また,結果をグラフィカルに表してくれるツールとして,合わせて Kippo-Graph も導入する。

・Cowrieの導入(ほとんどGitHub – micheloosterhof/cowrieの手順通り)
■1. Cowrie用のユーザー追加

adduser cowrie
passwd cowrie

■2. 必要なパッケージ類のインストール

$ sudo apt-get install git python-virtualenv libmpfr-dev libssl-dev libmpc-dev libffi-dev build-essential libpython-dev python2.7-minimal authbind python-setuptools python-dev
$ sudo su - cowrie
$ git clone http://github.com/micheloosterhof/cowrie
$ cd cowrie
$ pwd
/home/cowrie/cowrie
$ virtualenv cowrie-env
$ source cowrie-env/bin/activate
(cowrie-env) $ pip install -r requirements.txt

■3. 設定ファイル

$ pwd
/home/cowrie/cowrie
$ cp cowrie.dfg.dist cowrie.cfg
$ vi cowrie.cfg <- 必要な設定を行ってください(そのままでも動作するそうです)

■4. 実行と終了

$ ./bin/cowrie start
$ ./bin/cowrie stop

Cowrieはデフォルトで2222番が待ち受けポートなので,次の設定により22番に来た通信を2222番にリダイレクトする。
■5. ポートリダイレクト

$ sudo iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2222

以上の設定で,sshハニーポットCowrieが構築できる。ちなみに,Cowrie用のダミーユーザー情報は/home/cowrie/cowrie/data/userdb.txtに格納されている。
■vi /home/cowrie/cowrie/data/userdb.txt

root:x:!root
root:x:123456
root:x:password

このファイルに,ユーザー名:x:パスワードのように記述することで,ダミーユーザーを定義できる。(上の設定では,root/123456 , root/passwordの組み合わせでsshにログインできる)

・Kippo-Graphの導入
■1. MySqlのセットアップ

$ sudo apt-get install mysql-server libmysqlclient-dev 

$ mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

$ sudo vi /etc/mysql/my.cnf

[mysql]
default-character-set=utf8

$ sudo systemctl restart mysql

■2. Cowrie用のデータベースの作成

$ mysql -u root -p
Enter password:
mysql> create database cowrie;
mysql> grant all privileges on cowrie.* to cowrie@localhost identified by 'cowrie_password';
mysql> quit

$ cd /home/cowrie/cowrie
$ mysql -u cowrie -p
Enter password:
mysql> source doc/sql/mysql.sql
mysql> quit

■3. CowrieのログをMySqlに保存する設定

$ pwd
/home/cowrie/cowrie
$ vi cowrie.cfg
#[output_mysql]
#host = localhost
#database = cowrie
#username = cowrie
#password = secret
#port = 3306
   ↓
[output_mysql]
host = localhost
database = cowrie
username = cowrie
password = cowrie_password
port = 3306

■4. Apache2のインストールと設定

$ sudo apt-get install apache2
$ sudo nano /etc/apache2/conf-available/security.conf
ServerTokens Prod
ServerSignature Off

$ sudo vi /etc/apache2/conf-available/charset.conf
#AddDefaultCharset UTF-8

$ sudo apachectl configtest
$ sudo systemctl restart apache2

■5. Kippo-Graphのインストール(ver.1.5.1)

$ wget http://bruteforce.gr/wp-content/uploads/kippo-graph-1.5.1.tar.gz
$ sudo tar zxvf kippo-graph-1.5.1.tar.gz -C /usr/share
$ sudo vi /etc/apache2/conf-available/kippo-graph.conf
<IfModule mod_alias.c>
    Alias /kippo-graph /usr/share/kippo-graph-1.5.1
</IfModule>
$ sudo a2enconf kippo-graph
$ sudo apachectl configtest
$ sudo systemctl restart apache2
$ sudo chmod 777 /usr/share/kippo-graph-1.5.1/generated-graphs/
$ sudo cp -p /usr/share/kippo-graph-1.5.1/config.php.dist /usr/share/kippo-graph-1.5.1/config.php
$ sudo vi /usr/share/kippo-graph-1.5.1/config.php
define('DB_HOST', 'localhost');
define('DB_USER', 'cowrie');
define('DB_PASS', 'cowrie_password');
define('DB_NAME', 'cowrie');
define('DB_PORT', '3306');

Kippo-GraphはもともとKippoのために作成されたものなので,Cowrieでは動かない部分もあるので,その部分の修正を行う。
■6. Kippo-Graphの修正

$ cd /usr/share/kippo-graph-1.5.1
$ sudo cp -p class/KippoPlayLog.class.php class/KippoPlayLog.class.php.org
$ sudo vi class/KippoPlayLog.class.php
$ $ diff class/KippoPlayLog.class.php.org class/KippoPlayLog.class.php
21c21
< SELECT ttylog.session, timestamp, ROUND(LENGTH(ttylog)/1024, 2) AS size --- >             SELECT ttylog.session, timestamp, ROUND(size/1024, 2) AS sizediff class/KippoPlayLog.class.php.org class/KippoPlayLog.class.php
21c21
< SELECT ttylog.session, timestamp, ROUND(LENGTH(ttylog)/1024, 2) AS size --- >             SELECT ttylog.session, timestamp, ROUND(size/1024, 2) AS size
$ cd /usr/share/kippo-graph-1.5.1
$ sudo cp -p include/play.php include/play.php.org
$ sudo vi include/play.php
$ diff -u ./include/play.php.org ./include/play.php 
--- ./include/play.php.org      2017-04-27 21:53:10.404195307 +0900 
+++ ./include/play.php  2017-04-27 21:53:44.363874892 +0900 
@@ -67,7 +67,7 @@ 
             $rows = R::getAll($db_query); 
  
             foreach ($rows as $row) { 
-                $log = base64_encode($row['ttylog']); 
+                $log = base64_encode(file_get_contents($row['ttylog'])); 
             } 
  
             $db_query = "SELECT ip, starttime FROM sessions WHERE id='$session'";

$ cd /usr/share/kippo-graph-1.5.1/include
$ sudo ln -s ${COWRIE_INSTALL_DIR}/log/ log
$ sudo chgrp www-data /home/cowrie/cowrie/log/tty/
$ sudo chmod g+s /home/cowrie/cowrie/log/tty/

■7. Cowrie起動スクリプトの修正

$ pwd
/home/cowrie/cowrie
$ cp -p start.sh start.sh.org
$ vi start.sh
$ diff -u start.sh.org start.sh
--- ./start.sh.org      2017-04-27 21:55:42.942756469 +0900 
+++ ./start.sh  2017-04-27 21:56:47.512147707 +0900 
@@ -37,7 +37,7 @@ 
 echo "Starting cowrie with extra arguments [$XARGS $DAEMONIZE] ..." 
 if [ $AUTHBIND_ENABLED = "no" ] 
 then 
-    twistd $XARGS $DAEMONIZE -l log/cowrie.log --umask 0077 --pidfile ${PIDFILE} cowrie 
+    twistd $XARGS $DAEMONIZE -l log/cowrie.log --umask 0027 --pidfile ${PIDFILE} cowrie 
 else 
-    authbind --deep twistd $DAEMONIZE $XARGS -l log/cowrie.log --umask 0077 --pidfile ${PIDFILE} cowrie
+    authbind --deep twistd $DAEMONIZE $XARGS -l log/cowrie.log --umask 0027 --pidfile ${PIDFILE} cowrie
 fi

■8. Cowrieの再起動

$ pwd
/home/cowrie
$ ./bin/cowrie stop
$ ./bin/cowrie start

以上で Cowrie と Kippo-Graph の導入は完了

こんな感じの画面が表示される。

参考サイト
ハニーポットCowrieをCentOS7に入れてみた。
ハニーポットCowrieのログをMySQLに突っ込んでKippo-Graphで可視化した話

kubuntu 16.04 に bumblebee を導入

ubuntu 16.04 に bumblebee を導入する手順を紹介しているサイトは英語であればたくさんあったが,その手順通りに操作を行っても起動後に画面がブラックアウトしてしまい正常に動作しなかった。

時間がないので手順は記さない(時間が空いたら書こうと思う)が,正常に動作させることのできたサイトはこちらです。

https://rajat-osgyan.blogspot.jp/2016/07/bumblebee-on-ubuntu-1604-revised.html

正常に動作しなかった原因として考えられるのは,リポジトリに
ppa:neon1ks/bumblebeeを追加していたからだと思う。

とりあえず参考までに…

自作パソコン1号機

念願だったパソコンの自作を行いました。
作成したのは少し前になるのですが,構成について残しておこうと思う。

2016年9月頃になるべく高性能のものをと思い構成を行った。

構成
部品名 種類 購入価格
CPU Intel「Core i7-6900K」仕様 116,720円
CPUクーラー クーラーマスター「Hyper 612 Ver.2 RR-H6V2-13PK-J1」 6426円
マザーボード MSI「X99A SLI Krait Edition」 30,980円
メモリー Corsair「CMK32GX4M2B3000C15」(DDR4 PC4-24000 16GB x 2) 18,547円
SSD SanDisk「SSD PLUS SDSSDA-120G-J26C」(120GB、SATA)x 2 5270円 x 2
ビデオカード ZOTAC「GeForce GTX 1080 AMP Extreme」
(GeForce GTX 1080、8GB)
90,124円
PCケース Corsair「Obsidian 750D CC-9011035-WW」
(フルタワー、~ E-ATX)
24,480円
電源ユニット Owltech「Seasonic X Series 860W SS-860XP2S」 27,864円
ディスプレイ LG「24MP88HV-S」 26,568円
総額   352,249円

OSはCentOS 7.1を利用しています。
今後このパソコンのベンチマーク結果などを載せていこうと思います。

CentOS7 に Skype Dynamicバージョンをインストール

インストールしていく過程で nux-dextop リポジトリが必要となる。また,nux-dextop は依存関係で epel リポジトリも必要となるため,epel と nux-dextop を導入しておくこと。

Skype for Linux は nux-dextop リポジトリからインストールも可能
# yum --enablerepo=nux-dextop skype
だが,私の個人的な趣味で Dynamic バージョンをインストールした。

一応,yumからインストールできないように/etc/yum.confの中に
exclude=skype
の記述を追加。excludeが既に存在している場合はスペースを開けてskypeを追加する。

・Skype for Linux の Dynamic バージョンのダウンロード
# wget http://www.skype.com/go/getskype-linux-beta-dynamic -O skype-4.3.0.37.tar.bz2

これを適当な場所に展開し,パスの通っている場所にシンボリックリンクを作成。(例えば/usr/local以下)

 class="EnlighterJSRAW" data-enlighter-language="generic"# tar xvfj ./skype-4.3.0.37.tar.bz2 -C /usr/local
# ln -s /usr/local/skype-4.3.0.37/skype /usr/local/skype

・必要なライブラリ等のインストール

# yum install glibc.i686 libXv.i686 libXScrnSaver.i686 qt.i686
# yum --enablerepo=nux-dextop install qtwebkit.i686
# yum install pulseaudio-libs.i686 alsa-plugins-pulseaudio.i686
# yum install libv4l.i686

・起動(/usr/local以下に導入した場合)
$ skype --resources=/usr/local/skype-4.3.0.37
参考サイト:https://wiki.centos.org/HowTos/Skype

以上!

VMware Player マウスカーソルの位置がずれる(解決)

ホストOS : CentOS 7
ゲストOS : Windows 7(x64)、Windows 8.1(x64)
VMware Player Version : 12.1.1

で使用している際に、ゲストOSを表示しているウィンドウを移動させると
それに伴い、ゲスト側でのマウスカーソルの位置がずれる現象が起こった。
フルスクリーンモード、または起動直後のウィンドウの位置のまま動かさなければ
問題はないが、このままでは不便なので解決方法を探したら、こんなのを見つけた

http://kb.vmware.com/kb/1000225

この記事によるとVMware PlayerのゲストOSの設定ファイル xxx.vmx に次の一行を追加するだけです。
vmmouse.present = "FALSE"
これでウィンドウを移動させても正常に表示されるようになりました。

注) 但し、VMware Player のマネージャー?から起動させた場合は正常に動作せず、直接 xxx.vmx から起動させた場合のみ正常に動作した。

—– 追記 2016/12/13 —–

VMware Player Version : 12.5.2
に更新したらわざわざxxx.vmxから起動しなくても正常に動作するようになりました。

rpmforge-releaseダウンロードできない(解決方法)

注) このページで rpmforge を利用できるように案内していますが,RPMForge (RepoForge) 終了のお知らせによると2年以上更新が行われていないそうです。セキュリティ上安全とは言えないので使用しないほうが良さそうです。

rpmforgeの導入で、通常
http://pkgs.repoforge.org/rpmforge-release/
からrpmforge-releaseをダウンロードするが、
このサイトがダウンしており導入が行えなかった。

しばらく待ったが、復旧する見込みがないので別の方法で導入を行った。

理研の
http://ftp.riken.jp/Linux/repoforge/redhat/
から
[使用しているバージョン]

[en/]

[アーキテクチャの種類]

[rpmforge/]

[RPMS/]
と順にクリックしていくとrpmforgeが管理しているrpm一覧が表示される。
この中にrpmforge-releaseのrpmがあるので、次のように(例はCentOS 6, i386の場合)
# rpm -ivh http://ftp.riken.jp/Linux/repoforge/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
とするとインストールを行うことができる。

と言っても,RepoForgeのページによると
アップデートされなさそうなので使用しないほうが良さそうだ。

gnuplot tab 補完を有効にする

私は,現在CentOS7を使用していますが,gnuplot で Tab 補完をする際の挙動が,CentOS6を使用していた頃のものと変わっており,不便だったのでソースファイルからビルドしてインストールを行った。

調べてみると,ライセンスの関係でreadlineのライブラリがデフォルトで利用できなくなっているのが原因であることが分かった。

実際に読み込まれるライブラリをCentOS6とCentOS7で見てみると(どちらもyumでインストールしたもの)

・CentOS6

$ which gnuplot
/usr/bin/gnuplot
$ ldd /usr/bin/gnuplot
        linux-gate.so.1 =>  (0x00f2e000)
        libreadline.so.6 => /lib/libreadline.so.6 (0x00122000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x008e8000)  
        libz.so.1 => /lib/libz.so.1 (0x0010c000)              
        libgd.so.2 => /usr/lib/libgd.so.2 (0x0015e000)        
        libXpm.so.4 => /usr/lib/libXpm.so.4 (0x042be000)      
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00346000)      
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x056f2000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0066a000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x005cf000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0x006a1000)
        libm.so.6 => /lib/libm.so.6 (0x00dd4000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x004e0000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00482000)
        libc.so.6 => /lib/libc.so.6 (0x00c16000)
        libtinfo.so.5 => /lib/libtinfo.so.5 (0x00a6c000)
        libdl.so.2 => /lib/libdl.so.2 (0x00dcd000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00322000)
        libexpat.so.1 => /lib/libexpat.so.1 (0x004b6000)
        /lib/ld-linux.so.2 (0x00bf0000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x0031d000)

・CentOS7

$ which gnuplot
/usr/bin/gnuplot
$ ldd /usr/bin/gnuplot
        linux-vdso.so.1 =>  (0x00007fff3b96b000)
        libncurses.so.5 => /lib64/libncurses.so.5 (0x00007fc31472e000)
        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fc314503000)
        libedit.so.0 => /lib64/libedit.so.0 (0x00007fc3142c6000)
        libz.so.1 => /lib64/libz.so.1 (0x00007fc3140b0000)
        libgd.so.2 => /lib64/libgd.so.2 (0x00007fc313e68000)
        libXpm.so.4 => /lib64/libXpm.so.4 (0x00007fc313c56000)
        libX11.so.6 => /lib64/libX11.so.6 (0x00007fc313918000)
        libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007fc3136c2000)
        libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007fc313486000)
        libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007fc3131e0000)
        libpng15.so.15 => /lib64/libpng15.so.15 (0x00007fc312fb4000)
        liblua-5.1.so => /lib64/liblua-5.1.so (0x00007fc312d86000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fc312a84000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fc31287f000)
        libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0 (0x00007fc312672000)
        libpango-1.0.so.0 => /lib64/libpango-1.0.so.0 (0x00007fc312427000)
        libcairo.so.2 => /lib64/libcairo.so.2 (0x00007fc3120ff000)
        libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007fc311eaf000)
        libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007fc311b78000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc31186f000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc311659000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc311297000)
        libxcb.so.1 => /lib64/libxcb.so.1 (0x00007fc311074000)
        libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fc310e4a000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc310c2e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc314973000)
        libpangoft2-1.0.so.0 => /lib64/libpangoft2-1.0.so.0 (0x00007fc310a18000)
        libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007fc310814000)
        libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00007fc310612000)
        libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00007fc3103b8000)
        libpixman-1.so.0 => /lib64/libpixman-1.so.0 (0x00007fc31010b000)
        libEGL.so.1 => /lib64/libEGL.so.1 (0x00007fc30feea000)
        libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x00007fc30fce5000)
        libxcb-render.so.0 => /lib64/libxcb-render.so.0 (0x00007fc30fadb000)
        libXrender.so.1 => /lib64/libXrender.so.1 (0x00007fc30f8d1000)
        libXext.so.6 => /lib64/libXext.so.6 (0x00007fc30f6be000)
        libGL.so.1 => /lib64/libGL.so.1 (0x00007fc30f427000)
        librt.so.1 => /lib64/librt.so.1 (0x00007fc30f21f000)
        libffi.so.6 => /lib64/libffi.so.6 (0x00007fc30f016000)
        libXau.so.6 => /lib64/libXau.so.6 (0x00007fc30ee12000)
        libgraphite2.so.3 => /lib64/libgraphite2.so.3 (0x00007fc30ebe4000)
        libX11-xcb.so.1 => /lib64/libX11-xcb.so.1 (0x00007fc30e9e2000)
        libxcb-dri2.so.0 => /lib64/libxcb-dri2.so.0 (0x00007fc30e7dd000)
        libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0 (0x00007fc30e5d4000)
        libxcb-shape.so.0 => /lib64/libxcb-shape.so.0 (0x00007fc30e3d0000)
        libgbm.so.1 => /lib64/libgbm.so.1 (0x00007fc30e1c4000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fc30df9e000)
        libdrm.so.2 => /lib64/libdrm.so.2 (0x00007fc30dd91000)
        libglapi.so.0 => /lib64/libglapi.so.0 (0x00007fc30db62000)
        libXdamage.so.1 => /lib64/libXdamage.so.1 (0x00007fc30d95f000)
        libXfixes.so.3 => /lib64/libXfixes.so.3 (0x00007fc30d759000)
        libxcb-glx.so.0 => /lib64/libxcb-glx.so.0 (0x00007fc30d53e000)
        libxcb-dri3.so.0 => /lib64/libxcb-dri3.so.0 (0x00007fc30d33b000)
        libxcb-present.so.0 => /lib64/libxcb-present.so.0 (0x00007fc30d138000)
        libxcb-randr.so.0 => /lib64/libxcb-randr.so.0 (0x00007fc30cf29000)
        libxcb-sync.so.1 => /lib64/libxcb-sync.so.1 (0x00007fc30cd22000)
        libxshmfence.so.1 => /lib64/libxshmfence.so.1 (0x00007fc30cb1f000)
        libXxf86vm.so.1 => /lib64/libXxf86vm.so.1 (0x00007fc30c918000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fc30c6b7000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fc30c491000)

このように,CentOS6では読み込まれていたreadlineがCentOS7では読み込まれていなかった。

それでは,readlineを使用できるようにソースからビルドしていく。環境はCentOS7だが,他の環境でもパッケージを読み替えればできると思う。

  1. gnuplotの削除とリポジトリからインストールできないようにする
    # yum remove gnuplot
    /etc/yum.conf に以下の記述を追記
    exclude=gnuplot*
    excludeが存在していれば後ろにスペースを開けてgnuplot*を書く。このように設定するとリポジトリからgnuplotがインストールされなくなる。
  2. readline-develのインストール
    これが入っていないと,このあとの作業をおこなっても意味がないので入れておく。
    # yum install readline-devel
  3. gnuplot のソースファイルをダウンロード & 展開
    以下のコマンドでgnuplotの最新版(現在[2016/07/31]はver.5.0.4)がダウンロードできる。

    # wget "https://sourceforge.net/projects/gnuplot/files/latest/download?source=files" -O gnuplot-latest.tar.gz
    # tar zxvf gnuplot-latest.tar.gz
  4. gnuplot のビルド と インストール
    展開されたディレクトリの中に移動して
    # cd gnuplot-5.0.4
    readlineを利用するように設定する。
    # ./configure --with-readline=gnu
    そして,コンパイルとインストールを行う。
    # make && make install

これでインストール完了
最後にlddの結果を載せておく

ldd /usr/local/bin/gnuplot 
        linux-vdso.so.1 =>  (0x00007fffdf3cd000)
        libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f38519f2000)
        libncurses.so.5 => /lib64/libncurses.so.5 (0x00007f38517ca000)
        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f38515a0000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f385138a000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f3851185000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f3850e7d000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f3850b7b000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f3850964000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f38505a2000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3851c56000)

無事readlineが読み込まれるようになった。最初の結果と比べるとライブラリの読み込み量がすごく減っているけど大丈夫だろうか?設定の問題だろうが…,また問題が出てきたら考えることにする。

———- 追記 ———-
使用していて,PNGやJPEGに出力が出来なかった。
使用できるようにするためにはgd-develがインストールされている必要があり
# yum install gd-devel
でインストールできる。
この状態で

# ./configure --with-readline=gnu --with-gd
# make && make install

として,インストールすればPNG,JPEG出力ができるようになる。

ghostscript 日本語フォントの設定

TeXで,tex -> dvi -> ps -> pdf の順でファイルを生成していく際に,日本語の文字化けの対処でつまずいたのでメモを残しておく。最後のPDFファイルで文字化けを起こす理由は,ghostscriptに日本語のフォントが設定されていないからである。

環境はlinuxのCentOSとUbuntuの2つについて。TeXは,リポジトリに登録されているものではなく,本家のtexlive(texlive2016)を利用する。

どちらの環境でも次のページ

TeX Live 2013 on Scientific Linux 6.4

を参考にしてtexliveをインストールした(texliveインストール後のパスの設定まで)。
この状態で platex -> dvips -> ps2pdf を実行すると文字化けしたPDFファイルが生成されるが,どちらのの環境のPSファイルのヘッダ?部分は次のようになっている。

%!PS-Adobe-2.0
%%Creator: dvips(k) 5.996 Copyright 2016 Radical Eye Software
%%Title: potts_model.dvi
%%CreationDate: Wed Dec 31 23:59:59 1969
%%Pages: 22
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
%%DocumentFonts: IPAexMincho-H CMR12 CMBX10 IPAexGothic-H CMSS10 CMR10
%%+ CMSS17 CMSS12 CMR9 CMMI10 CMSY10 CMMI7 CMR7 CMMIB10 CMEX10 CMSY7
%%+ CMMIB7 CMR5 CMMI5 Helvetica CMMIB9 CMSY6 CMMI6 CMMI9 CMR6 CMSY5
%%+ CMBSY5 CMMIB5
%%DocumentPaperSizes: a4
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips potts_model.dvi
%DVIPSParameters: dpi=600
%DVIPSSource:  TeX output 2016.07.05:1751
%%BeginProcSet: tex.pro 0 0
%!

ghostscriptの日本語フォントが昔のものと異なっており,また設定ファイルをどこに記述すればよいのかわからず,はまってしまった…
この文字化け解消のためにそれぞれの環境でつぎのように設定を行う。

  • CentOS(7.2)
    次のコマンドでシンボリックリンクを作成
    # ln -s /usr/local/texlive/2016/texmf-dist/fonts/truetype/public/ipaex /usr/share/fonts/ipaex
    /etc/ghostscript/cidfmap.ja に以下のものを記述

    /IPAexMincho     << /FileType /TrueType /Path (/usr/share/fonts/ipaex/ipaexm.ttf) /CSI [(Japan1) 6] >> ;
    /IPAexGothic     << /FileType /TrueType /Path (/usr/share/fonts/ipaex/ipaexg.ttf) /CSI [(Japan1) 6] >> ;
    
  • Ubuntu(16.04)
    次のコマンドでシンボリックリンクを作成
    # ln -s /usr/local/texlive/2016/texmf-dist/fonts/truetype/public/ipaex /usr/share/fonts/truetype/ipaex
    /usr/share/ghostscript/9.18/Resource/Init/cidfmapに以下のものを記述

    /IPAexMincho << /FileType /TrueType /Path (/usr/share/fonts/truetype/ipaex/ipaexm.ttf) /CSI [(Japan1) 6] >> ;
    /IPAexGothic << /FileType /TrueType /Path (/usr/share/fonts/truetype/ipaex/ipaexg.ttf) /CSI [(Japan1) 6] >> ;
    

このように設定することで日本語に対応することができた。
PSファイルのDocumentfontsと,ghostscriptの設定を記述する場所に気をつけなければならない。

参考にしたページ → Ubuntu 日本語LaTeX環境構築方法

—– 追記 —–
このあと,この設定で使用していたら文字が用紙からはみ出してしまうという現象が起こった。これは用紙サイズの設定が正しくPSファイルに書きだされていなかったためで,TeXファイルのプリアンブル部に\documentclass[12pt,a4paper,notitlepage,papersize]{jsbook}このようにpapersizeを付け加えることで解決した。

smartctl の内容について

smartctlコマンドは、ハードディスクのS.M.A.R.T.(Self-Monitoring, Analysis and Reporting Technology System)情報を確認するものである。いつもこのコマンドを使うたびに出力内容について検索していたので、ここにまとめておく。

  1. 基本的な使用方法
    # smartctl [オプション] デバイス名
    オプションには様々あるが、今回は”-a”のみ。
  2. コマンドの実行結果
    # smartctl -a /dev/sda
    smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-229.20.1.el7.x86_64] (local build)
    Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF INFORMATION SECTION ===
    Model Family:     Western Digital Caviar Green (AF, SATA 6Gb/s)
    Device Model:     WDC WD20EZRX-00D8PB0
    Serial Number:    WD-WMC4N0F2RNSM
    LU WWN Device Id: 5 0014ee 0593e2f83
    Firmware Version: 80.00A80
    User Capacity:    2,000,398,934,016 bytes [2.00 TB]
    Sector Sizes:     512 bytes logical, 4096 bytes physical
    Rotation Rate:    5400 rpm
    Device is:        In smartctl database [for details use: -P show]
    ATA Version is:   ACS-2 (minor revision not indicated)
    SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
    Local Time is:    Tue May 31 13:46:51 2016 JST
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    
    General SMART Values:
    Offline data collection status:  (0x84)	Offline data collection activity
    					was suspended by an interrupting command from host.
    					Auto Offline Data Collection: Enabled.
    Self-test execution status:      (   0)	The previous self-test routine completed
    					without error or no self-test has ever 
    					been run.
    Total time to complete Offline 
    data collection: 		(27420) seconds.
    Offline data collection
    capabilities: 			 (0x7b) SMART execute Offline immediate.
    					Auto Offline data collection on/off support.
    					Suspend Offline collection upon new
    					command.
    					Offline surface scan supported.
    					Self-test supported.
    					Conveyance Self-test supported.
    					Selective Self-test supported.
    SMART capabilities:            (0x0003)	Saves SMART data before entering
    					power-saving mode.
    					Supports SMART auto save timer.
    Error logging capability:        (0x01)	Error logging supported.
    					General Purpose Logging supported.
    Short self-test routine 
    recommended polling time: 	 (   2) minutes.
    Extended self-test routine
    recommended polling time: 	 ( 277) minutes.
    Conveyance self-test routine
    recommended polling time: 	 (   5) minutes.
    SCT capabilities: 	       (0x7035)	SCT Status supported.
    					SCT Feature Control supported.
    					SCT Data Table supported.
    
    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       1
      3 Spin_Up_Time            0x0027   189   170   021    Pre-fail  Always       -       5533
      4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       45
      5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
      9 Power_On_Hours          0x0032   081   081   000    Old_age   Always       -       14072
     10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
     11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       45
    192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       9
    193 Load_Cycle_Count        0x0032   069   069   000    Old_age   Always       -       395783
    194 Temperature_Celsius     0x0022   115   108   000    Old_age   Always       -       35
    196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
    198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
    200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0
    
    SMART Error Log Version: 1
    No Errors Logged
    
    SMART Self-test log structure revision number 1
    No self-tests have been logged.  [To run self-tests, use: smartctl -t]
    
    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    
  3. 出力結果の詳細

      1. HDDの情報(オプション”-i”で単独に出力可能)
        Model Family:     Western Digital Caviar Green (AF, SATA 6Gb/s)
        Device Model:     WDC WD20EZRX-00D8PB0
        Serial Number:    WD-WMC4N0F2RNSM
        LU WWN Device Id: 5 0014ee 0593e2f83
        Firmware Version: 80.00A80
        User Capacity:    2,000,398,934,016 bytes [2.00 TB]
        Sector Sizes:     512 bytes logical, 4096 bytes physical
        Rotation Rate:    5400 rpm
        Device is:        In smartctl database [for details use: -P show]
        ATA Version is:   ACS-2 (minor revision not indicated)
        SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
        Local Time is:    Tue May 31 13:46:51 2016 JST
        SMART support is: Available - device has SMART capability.
        SMART support is: Enabled
        
      2. ヘルステストの結果(オプション”-H”で単独に出力可能)
        SMART overall-health self-assessment test result: PASSED
        
      3. デバイスが実装している SMART の機能(オプション”-c”で単独に出力可能)
        General SMART Values:
        Offline data collection status:  (0x84)	Offline data collection activity
        					was suspended by an interrupting command from host.
        					Auto Offline Data Collection: Enabled.
        Self-test execution status:      (   0)	The previous self-test routine completed
        					without error or no self-test has ever 
        					been run.
        Total time to complete Offline 
        data collection: 		(27420) seconds.
        Offline data collection
        capabilities: 			 (0x7b) SMART execute Offline immediate.
        					Auto Offline data collection on/off support.
        					Suspend Offline collection upon new
        					command.
        					Offline surface scan supported.
        					Self-test supported.
        					Conveyance Self-test supported.
        					Selective Self-test supported.
        SMART capabilities:            (0x0003)	Saves SMART data before entering
        					power-saving mode.
        					Supports SMART auto save timer.
        Error logging capability:        (0x01)	Error logging supported.
        					General Purpose Logging supported.
        Short self-test routine 
        recommended polling time: 	 (   2) minutes.
        Extended self-test routine
        recommended polling time: 	 ( 277) minutes.
        Conveyance self-test routine
        recommended polling time: 	 (   5) minutes.
        SCT capabilities: 	       (0x7035)	SCT Status supported.
        					SCT Feature Control supported.
        					SCT Data Table supported.
        
      4. ベンダー固有の属性情報(オプション”-A”で単独に出力可能)
        詳細はWikipedia

        SMART Attributes Data Structure revision number: 16
        Vendor Specific SMART Attributes with Thresholds:
        ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
          1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       1
          3 Spin_Up_Time            0x0027   189   170   021    Pre-fail  Always       -       5533
          4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       45
          5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
          7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
          9 Power_On_Hours          0x0032   081   081   000    Old_age   Always       -       14072
         10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
         11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
         12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       45
        192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       9
        193 Load_Cycle_Count        0x0032   069   069   000    Old_age   Always       -       395783
        194 Temperature_Celsius     0x0022   115   108   000    Old_age   Always       -       35
        196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
        197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
        198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
        199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
        200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0
        
      5. エラーログ(オプション”-l error”で単独に出力可能)
        SMART Error Log Version: 1
        No Errors Logged
        
      6. セルフテストの結果(オプション”-l selftest”で単独に出力可能)
        SMART Self-test log structure revision number 1
        No self-tests have been logged. [To run self-tests, use: smartctl -t]

     

    1. セレクティブセルフテストの結果(オプション”-l selective”で単独に出力可能)
      SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.