setodaNoteCTF write up

setodanoteCTF やってみました。
他の人もwrite upを公開しているので他の人より簡単な方法で解けたものだけピックアップ

 

Redacted

Redacted
150
あなたの友人のジャーナリストは極秘ファイルの入手に成功しました。ですが重要な部分が黒塗りにされてしまっているようです。このままでは真実が闇に葬り去られてしまいます。あなたは極秘ファイルの解析を依頼されました。

添付されたファイルを解析し、真実を明らかにしてください。

MS Officeが無かった のでgoogle ドキュメントに突っ込んでみたらなんかできた

 

 

 

pui_pui

pui_pui
80
組織の局長からチャットが来ました。ですが普通の文字列ではなく暗号文になっているようです。どうやらこの組織には暇人しかいないようです。

以下の文字列を変換して、フラグを獲得してください。

\x41\x3a\x44\x6f\x20\x79\x6f\x75\x20\x6b\x6e\x6f\x77\x20\x4d\x6f\x6c\x63\x61\x72\x3f\x0a\x0a\x42\x3a\x4f\x66\x20\x63\x6f\x75\x72\x73\x65\x21\x20\x49\x20\x6c\x6f\x76\x65\x20\x74\x68\x65\x20\x73\x63\x65\x6e\x65\x20\x77\x68\x65\x72\x65\x20\x68\x65\x20\x73\x69\x6e\x6b\x73\x20\x69\x6e\x74\x6f\x20\x74\x68\x65\x20\x62\x6c\x61\x73\x74\x20\x66\x75\x72\x6e\x61\x63\x65\x20\x77\x68\x69\x6c\x65\x20\x67\x69\x76\x69\x6e\x67\x20\x74\x68\x65\x20\x74\x68\x75\x6d\x62\x73\x20\x75\x70\x2e\x0a\x0a\x41\x3a\x2e\x2e\x2e\x20\x57\x68\x61\x74\x3f\x0a\x0a\x42\x3a\x62\x74\x77\x2c\x20\x74\x68\x65\x20\x66\x6c\x61\x67\x20\x69\x73\x20\x66\x6c\x61\x67\x7b\x48\x61\x76\x65\x5f\x79\x6f\x75\x5f\x65\x76\x65\x72\x5f\x68\x65\x61\x72\x64\x5f\x6f\x66\x5f\x48\x65\x78\x64\x75\x6d\x70\x3f\x7d\x2e\x0a

https://gchq.github.io/CyberChef/ に突っ込んでみた

 

 

 

tkys_secret_service

tkys_secret_service
120
分担が一区切りし拠点に立ち寄っていた後輩から、あなたが3か月前に送ってきたチャットが結局なんだったのか解けないでいると話しかけられました。そういえば暇だったから意味もなく秘匿回線で内偵中の後輩に暗号文を送っていたことを思い出します。

以下の文字列を解析してフラグを入手してください。

Gur cevgrsgbvh vp Pvhgevyyrq Hhsynmmbpbrq Vhpvezngbvh (PHV) ermbqrhg bh hvhprqreny mlmgrzm nhq vetnhbfngbvhm bm vp cnenzvahg bzcvegnhsr gv prqreny ntrhsbrm nhq snh qbersgyl bzcnsg gur nobybgl vp gur prqreny tvirehzrhg gv massrmmpayyl svhqasg bgm rmmrhgbny zbmmbvhm nhq pahsgbvhm. Gubm caoybsngbvh cevibqrm ntrhsbrm jbgu ersvzzrhqrq mrsaebgl erdaberzrhgm pve cevgrsgbht gur svhpbqrhgbnybgl vp PHV jurh gur bhpvezngbvh bm ermbqrhg bh hvhprqreny mlmgrzm nhq vetnhbfngbvhm; jurh gur hvhprqreny vetnhbfngbvh bm hvg svyyrsgbht ve znbhgnbhbht bhpvezngbvh vh orunyp vp n prqreny ntrhsl ve ambht ve vcrengbht n mlmgrz vh orunyp vp nh ntrhsl; nhq jurer gurer ner hv mcrsbpbs mnprtaneqbht erdaberzrhgm pve cevgrsgbht gur svhpbqrhgbnybgl vp Synt bm pynt{cabcab_sne_vp_zvy} PHV cermseborq ol gur naguvebfbht ynj, ertayngbvh, ve tvirehzrhgjbqr cvybsl pve gur PHV sngrtvel ybmgrq bh gur PHV Ertbmgel. Gur erdaberzrhgm nccyl gv nyy svzcvhrhgm vp hvhprqreny mlmgrzm nhq vetnhbfngbvhm gung cevsrmm, mgver, nhq/ve genhmzbg PHV, ve gung cevibqr cevgrsgbvh pve masu svzcvhrhgm. Gur mrsaebgl erdaberzrhgm ner bhgrhqrq pve amr ol prqreny ntrhsbrm bh svhgensgany irubsyrm ve vgure nterrzrhgm rmgnoybmurq orgjrrh guvmr ntrhsbrm nhq hvhprqreny vetnhbfngbvhm.

https://quipqiup.com/ これに突っ込むだけ

 

 

 

ZZZIPPP

ZZZIPPP
80
あなたはあるファイルの解析作業を依頼されました。何重にも入れ子になった箱のようなファイルのようで、その中に組織にとって重要な機密情報が入っているようです。

添付されたファイルを解析してフラグを入手してください。

for文でunzipするだけ

# for i in {1000..1}; do unzip flag${i}.zip; done

 

 

 

EZZZIPPP

EZZZIPPP
150
あなたは再びあるファイルの解析作業を依頼されました。何重にも入れ子になった箱のようなファイルですが、今度は鍵までかかっているようです。ファイルを解析し中に封じ込められている機密情報を取得してください。

ファイルを解析してフラグを入手してください。

パスワード追加して上書きのメッセージが出ないようにした

# for i in {1000..1}; do unzip -P $(cat pass.txt) -o flag${i}.zip; done

 

 

 

deep_thought

deep_thought
250
計算勝負をしましょう。普段は寡黙に働き続けているサーバが不意に話しかけてきました。あなたは珍しいこともあるものだと思いつつも、そのサーバからの挑戦を受けることにしました。

以下にアクセスしてフラグを得てください。

nc 10.1.1.10 12010

この設問では Linux ターミナルを使用します。
https://ctf.setodanote.net/webshell/

https://nkhrlab.hatenablog.com/entry/2017/10/19/205829 これそのままコピペしただけ

 

 

 

echo_me

echo_me
120
山登りが趣味だという同僚が疲れた様子で話しかけてきます。山でヤッホーと声を出せば、いつでもヤッホーと返ってくる。そんなあたりまえを支えるやまびこさんの気持ちって、どんな感じなんでしょうね。その眼には若干の狂気が宿っているようにも思えました。あなたは同僚を狂気から救うため、解析作業を手伝うことにしました。

以下にアクセスしてフラグを得てください。

nc 10.1.1.10 12020

この設問では Linux ターミナルを使用します。
https://ctf.setodanote.net/webshell/

上で使ったやつをちょこっと改変しただけ

  if response =~ /[\d]/ then
    answer = response.gsub(/[^\d]/, "").to_i
    print_if_not_int(answer.to_s + "\n")
    $sockout.write(answer.to_s + "\n")
  end

chinachuで全番組録画サーバーを作る

chinachuで全番組録画サーバーを作る

Ubuntu20.04とPX-MLT5PEとchinachuで録画サーバーを作る
PX-MLT5PE 2台を一つの(9ピン)USBコネクタで接続する
を組み合わせ全録鯖を作る

諸々終わるとデバイスが生えてくる

$ ls -l /dev/pxmlt5video*
crw-rw-r-- 1 root video 240, 0 Jun 26 00:41 /dev/pxmlt5video0
crw-rw-r-- 1 root video 240, 1 Jun 26 00:41 /dev/pxmlt5video1
crw-rw-r-- 1 root video 240, 2 Jun 26 00:41 /dev/pxmlt5video2
crw-rw-r-- 1 root video 240, 3 Jun 26 00:41 /dev/pxmlt5video3
crw-rw-r-- 1 root video 240, 4 Jun 26 00:41 /dev/pxmlt5video4
crw-rw-r-- 1 root video 240, 5 Jun 26 00:41 /dev/pxmlt5video5
crw-rw-r-- 1 root video 240, 6 Jun 26 00:41 /dev/pxmlt5video6
crw-rw-r-- 1 root video 240, 7 Jun 26 00:41 /dev/pxmlt5video7
crw-rw-r-- 1 root video 240, 8 Jun 26 00:41 /dev/pxmlt5video8
crw-rw-r-- 1 root video 240, 9 Jun 26 00:41 /dev/pxmlt5video9

chinachuのWEB UIには見ない(録画しない)チャンネルが生えてくるのでこれをconfig.jsonのexcludeServicesを書き換えて消す

不要なチャンネルIDはmirakurunのAPIを叩いて取得する。

$ curl -s "http://localhost:40772/api/services" | jq . 
[
  {
    "id": 3273601024,
    "serviceId": 1024,
    "networkId": 32736,
    "name": "NHK総合1・東京",
    "type": 1,
    "logoId": 0,
    "remoteControlKeyId": 1,
    "channel": {
      "type": "GR",
      "channel": "27"
    },
    "hasLogoData": true
  },
(...snip....)
  {
    "id": 3239723656,
    "serviceId": 23656,
    "networkId": 32397,
    "name": "J:COMテレビ",
    "type": 1,
    "logoId": 0,
    "remoteControlKeyId": 10,
    "channel": {
      "type": "GR",
      "channel": "13"
    },
    "hasLogoData": true
  },
  {
    "id": 3239723657,
    "serviceId": 23657,
    "networkId": 32397,
    "name": "J:COMテレビ",
    "type": 1,
    "logoId": 0,
    "remoteControlKeyId": 10,
    "channel": {
      "type": "GR",
      "channel": "13"
    },
    "hasLogoData": true
  },
  {
    "id": 3233527768,
    "serviceId": 27768,
    "networkId": 32335,
    "name": "J:COMチャンネル",
    "type": 1,
    "logoId": 10,
    "remoteControlKeyId": 11,
    "channel": {
      "type": "GR",
      "channel": "37"
    },
    "hasLogoData": true
  },
  {
    "id": 3233527769,
    "serviceId": 27769,
    "networkId": 32335,
    "name": "J:COMチャンネル",
    "type": 1,
    "logoId": 10,
    "remoteControlKeyId": 11,
    "channel": {
      "type": "GR",
      "channel": "37"
    },
    "hasLogoData": true
  },
  {
    "id": 3233527770,
    "serviceId": 27770,
    "networkId": 32335,
    "name": "J:COMチャンネル",
    "type": 1,
    "logoId": 10,
    "remoteControlKeyId": 11,
    "channel": {
      "type": "GR",
      "channel": "37"
    },
    "hasLogoData": true
  }
]

もっと見やすくするとこんな感じ

$ curl -s "http://localhost:40772/api/services" | jq ".[] | {name: .name, id: .id}"
{
  "name": "NHK総合1・東京",
  "id": 3273601024
}
(...snip....)
{
  "name": "J:COMテレビ",
  "id": 3239723656
}
{
  "name": "J:COMテレビ",
  "id": 3239723657
}
{
  "name": "J:COMチャンネル",
  "id": 3233527768
}
{
  "name": "J:COMチャンネル",
  "id": 3233527769
}
{
  "name": "J:COMチャンネル",
  "id": 3233527770
}

こんな感じにconfig.jsonのexcludeServices部分を書き足す

  "excludeServices": [
    3273701416,
    3232728088,
    3273901183,
    3274201456,
    3239123992,
    3239123993,
    3273601408,
    3273601025,
    3273701034,
    3232727705,
    3239723656,
    3239723657,
    3233527768,
    3233527769,
    3233527770,
    3239123610
  ],

pm2をリスタートさせる

$ sudo pm2 restart all

減った

GR(地上波)全部録画するのでチェックして作成

全部録画出来る

マルチチャンネルはexcludeServicesで弾かないと行けない(対象CHだけでは不十分)のがポイント

PX-MLT5PE 2台を一つの(9ピン)USBコネクタで接続する

PX-MLT5PEを2台PCに繋げたいんですが、マザーボード側に9ピンのコネクター1つしかついてないのでコネクタを弄って2つつけられるようにします。

9ピンの構造としてUSB2.0*2が生えるイメージなので、もう一本同じ様に配線するだけ

付属のコネクタ*2 を用意

一つ細いマイナスドライバーなどで爪を持ち上げ中のピンを外す

もう一個のコネクタの方に同じ様に挿す

出来上がり

あとは通常と同様にケーブルをカードとマザーボードに挿してドライバーを入れるだけ

$ ls -l /dev/pxmlt5video*
crw-rw-r-- 1 root video 240, 0 Jun 26 00:41 /dev/pxmlt5video0
crw-rw-r-- 1 root video 240, 1 Jun 26 00:41 /dev/pxmlt5video1
crw-rw-r-- 1 root video 240, 2 Jun 26 00:41 /dev/pxmlt5video2
crw-rw-r-- 1 root video 240, 3 Jun 26 00:41 /dev/pxmlt5video3
crw-rw-r-- 1 root video 240, 4 Jun 26 00:41 /dev/pxmlt5video4
crw-rw-r-- 1 root video 240, 5 Jun 26 00:41 /dev/pxmlt5video5
crw-rw-r-- 1 root video 240, 6 Jun 26 00:41 /dev/pxmlt5video6
crw-rw-r-- 1 root video 240, 7 Jun 26 00:41 /dev/pxmlt5video7
crw-rw-r-- 1 root video 240, 8 Jun 26 00:41 /dev/pxmlt5video8
crw-rw-r-- 1 root video 240, 9 Jun 26 00:41 /dev/pxmlt5video9

windows10 でディスプレイの電源が自動で切れなくなったときの対処法

PCの電源が常に入ってる状態でログオフし数分置いとくといつもは勝手にでディスプレイの電源が切れるが何かの拍子に切れない事があるのでそれのメモ

結論から言うとvlcが邪魔していて動作していなかったよう

このページが参考になりました。
いくら待ってもスリープ状態にならない時の原因と対処法 (Windows)

次に、下記を実行してみてください。

C:\WINDOWS\system32> powercfg /requests

このコマンドは、アプリケーションとドライバーの電源要求を列挙します。電源要求があると、ディスプレイの電源を自動的に切ることや、低電力のスリープ状態に移行することができません。

DISPLAY:「ディスプレイの電源を切る」
SYSTEM:「PCをスリープ状態にする」
AWAYMODE:「退席中モード」

とりあえず、cmd.exeを管理者モードで起動しコマンドを打ってみる

C:\Users\sekki>powercfg /requests
DISPLAY:
[PROCESS] \Device\HarddiskVolume4\Program Files\VideoLAN\VLC\vlc.exe
[PROCESS] \Device\HarddiskVolume4\Program Files (x86)\Google\Chrome\Application\chrome.exe
Video Wake Lock

SYSTEM:
[DRIVER] Realtek High Definition Audio (HDAUDIO\FUNC_01&VEN_10EC&DEV_0900&SUBSYS_104386AE&REV_1000\4&2de74382&0&0001)
現在 1 つのオーディオ ストリームが使用中です。
[PROCESS] \Device\HarddiskVolume4\Program Files\VideoLAN\VLC\vlc.exe
[DRIVER] レガシー カーネルの呼び出し元

AWAYMODE:
なし。

実行:
[PROCESS] \Device\HarddiskVolume4\Program Files (x86)\Google\Chrome\Application\chrome.exe
WebRTC has active PeerConnections

PERFBOOST:
なし。

ACTIVELOCKSCREEN:
なし。

多分このプロセスが邪魔している(chromeは音楽を流していたせい)
vlc.exeは起動していないのになぜかプロセスが残っていた。

DISPLAY:
[PROCESS] \Device\HarddiskVolume4\Program Files\VideoLAN\VLC\vlc.exe
[PROCESS] \Device\HarddiskVolume4\Program Files (x86)\Google\Chrome\Application\chrome.exe
Video Wake Lock

タスクマネージャーからvlcのプロセスを殺す。

DISPLAY:
[PROCESS] \Device\HarddiskVolume4\Program Files (x86)\Google\Chrome\Application\chrome.exe
Video Wake Lock

chromeの音楽を止めると

DISPLAY:
なし。

となる

何もしてない状態だとこんな感じ

C:\Users\sekki>powercfg /requests
DISPLAY:
なし。

SYSTEM:
[DRIVER] Realtek High Definition Audio (HDAUDIO\FUNC_01&VEN_10EC&DEV_0900&SUBSYS_104386AE&REV_1000\4&2de74382&0&0001)
現在 1 つのオーディオ ストリームが使用中です。

AWAYMODE:
なし。

実行:
なし。

PERFBOOST:
なし。

ACTIVELOCKSCREEN:
なし。

これで無事画面が消えるようになりました。
とりあえず、(ディスプレイの画面を消す場合)DISPLAYが「なし。」になる事が重要そうです。

今回はVLCのプロセスを殺して解決しましたが頻発するようであれば下記のようなコマンドで行けそう?(未確認)

powercfg -requestsoverride PROCESS  "\Device\HarddiskVolume4\Program Files\VideoLAN\VLC\vlc.exe" DISPLAY

Ubuntu20.04とPX-MLT5PEとchinachuで録画サーバーを作る

環境

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
$ uname -r
5.4.0-58-generic

必要に応じてadduserでユーザーを作っておきsudoできるようにしておく

$ sudo adduser rec
$ sudo visudo 

#タイムゾーンの設定
$ timedatectl
               Local time: Tue 2020-12-29 08:29:51 UTC
           Universal time: Tue 2020-12-29 08:29:51 UTC
                 RTC time: Tue 2020-12-29 08:29:51    
                Time zone: Etc/UTC (UTC, +0000)       
System clock synchronized: yes                        
              NTP service: active                     
          RTC in local TZ: no   
$ sudo timedatectl set-timezone Asia/Tokyo
$ timedatectl
               Local time: Tue 2020-12-29 17:30:48 JST
           Universal time: Tue 2020-12-29 08:30:48 UTC
                 RTC time: Tue 2020-12-29 08:30:48    
                Time zone: Asia/Tokyo (JST, +0900)    
System clock synchronized: yes                        
              NTP service: active                     
          RTC in local TZ: no 

PX-MLT5PEドライバーのインストール
https://github.com/nns779/px4_drv を見ながら粛々と入れる

$ sudo apt install -y unzip gcc make
$ mkdir src
$ cd src/
$ git clone https://github.com/nns779/px4_drv.git
$ cd px4_drv/fwtool/
$ make
$ wget http://plex-net.co.jp/plex/pxw3u4/pxw3u4_BDA_ver1x64.zip -O pxw3u4_BDA_ver1x64.zip
$ unzip -oj pxw3u4_BDA_ver1x64.zip pxw3u4_BDA_ver1x64/PXW3U4.sys
$ ./fwtool PXW3U4.sys it930x-firmware.bin
$ mkdir -p /lib/firmware
$ sudo cp it930x-firmware.bin /lib/firmware/
$ cd ../
##### DKMSを使用しない場合
$ cd driver
$ make
$ sudo make install
#####
$ lsmod | grep -e ^px4_drv
$ ls /dev/pxmlt5video*
/dev/pxmlt5video0  /dev/pxmlt5video1  /dev/pxmlt5video2  /dev/pxmlt5video3  /dev/pxmlt5video4

ubuntuは自動的にカーネルがアップデートされるので、ドライバーが消えるのでDKMSでインストールしたほうが良いかもしれない。
(もしくはアップデートを自動で止める)

$ sudo cp -a ./ /usr/src/px4_drv-0.2.1
$ sudo dkms add px4_drv/0.2.1
$ sudo dkms install px4_drv/0.2.1
$ lsmod | grep -e ^px4_drv
px4_drv               143360  0
$ ls -l /dev/pxmlt5video*
crw-rw-r-- 1 root video 239, 0 Aug 23 22:37 /dev/pxmlt5video0
crw-rw-r-- 1 root video 239, 1 Aug 23 22:37 /dev/pxmlt5video1
crw-rw-r-- 1 root video 239, 2 Aug 23 22:37 /dev/pxmlt5video2
crw-rw-r-- 1 root video 239, 3 Aug 23 22:37 /dev/pxmlt5video3
crw-rw-r-- 1 root video 239, 4 Aug 23 22:37 /dev/pxmlt5video4
crw-rw-r-- 1 root video 239, 5 Aug 23 22:37 /dev/pxmlt5video5
crw-rw-r-- 1 root video 239, 6 Aug 23 22:37 /dev/pxmlt5video6
crw-rw-r-- 1 root video 239, 7 Aug 23 22:37 /dev/pxmlt5video7
crw-rw-r-- 1 root video 239, 8 Aug 23 22:37 /dev/pxmlt5video8
crw-rw-r-- 1 root video 239, 9 Aug 23 22:37 /dev/pxmlt5video9

カードリーダードライバのインストール
#好みのやり方で

arib25ライブラリのインストール

$ sudo apt install -y cmake  build-essential libpcsclite-dev

$ cd ~/src/
$ git clone https://github.com/stz2012/libarib25.git
$ cd libarib25/
$ cmake .
$ make
$ sudo make install
$ 

recpt1のインストール

$ cd ~/src/
$ wget http://plex-net.co.jp/download/linux/Linux_Driver.zip
$ unzip Linux_Driver.zip
$ cd Linux_Driver/MyRecpt1/MyRecpt1/recpt1
$ sed -i".org" 's/-DTV/video/g' pt1_dev.h
$ sh ./autogen.sh 
$ sh ./configure --enable-b25
$ make clean
$ make
$ sudo make install

録画の確認
エラーが出たら上の手順をやり直す

$ recpt1 --device /dev/pxmlt5video1 --b25 --strip --sid hd 27 10 test.ts
using device: /dev/pxmlt5video1
using B25...
enable B25 strip
device = /dev/pxmlt5video1
C/N = 22.501011dB
(PID:4648)(CH:T27) Recording...
Available sid = 1024 1025 1408 65520 
Chosen sid    = 1024
Available PMT = 0x1f0 0x3f0 0x1fc8 0x1cf0 
(PID:4648)(CH:T27) Recorded 10sec

–deviceでデバイスを指定しないとエラーになる。

$ recpt1 --b25 --strip --sid hd 27 10 test.ts
using B25...
enable B25 strip
(tune) Cannot tune to the specified channel

Mirakurunのインストール
この辺を見ながらインストール

$ sudo apt install -y pkg-config
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ sudo npm install pm2 -g
$ sudo npm install mirakurun -g --unsafe-perm
$ sudo npm install rivarun -g
$ sudo npm install arib-b25-stream-test -g --unsafe
$ sudo mirakurun config tuners # 下のテキストっぽく修正
$ sudo mirakurun restart

中身はこんな感じ

- name: PX-MLT5PE0
  types:
    - GR
  command: /usr/local/bin/recpt1 --device /dev/pxmlt5video0 <channel> - -
  decoder: arib-b25-stream-test
  isDisabled: false

- name: PX-MLT5PE1
  types:
    - GR
  command: /usr/local/bin/recpt1 --device /dev/pxmlt5video1 <channel> - -
  decoder: arib-b25-stream-test
  isDisabled: false

- name: PX-MLT5PE2
  types:
    - GR
  command: /usr/local/bin/recpt1 --device /dev/pxmlt5video2 <channel> - -
  decoder: arib-b25-stream-test
  isDisabled: false

- name: PX-MLT5PE3
  types:
    - GR
  command: /usr/local/bin/recpt1 --device /dev/pxmlt5video3 <channel> - -
  decoder: arib-b25-stream-test
  isDisabled: false

- name: PX-MLT5PE4
  types:
    - GR
  command: /usr/local/bin/recpt1 --device /dev/pxmlt5video4 <channel> - -
  decoder: arib-b25-stream-test
  isDisabled: false

チャンネルが取得できる事を確認

$ curl -X PUT "http://localhost:40772/api/config/channels/scan"
channel scanning... (type: "GR")
(略)
-> total 11 channels found and 34 channels stored.

channel scan has completed and saved successfully.
**RESTART REQUIRED** to apply changes

この辺を見ながらChinachuインストール

$ sudo apt install -y python2
$ git clone git://github.com/Chinachu/Chinachu.git ~/chinachu
$ cd ~/chinachu/
$ EPYTHON=python2 ./chinachu installer
$ cp config.sample.json config.json
$ vim config.json #公式を見ながら修正
$ echo [] > rules.json
$ ./chinachu service wui execute
$ ./chinachu update
$ sudo pm2 start processes.json
$ sudo pm2 save
$ sudo pm2 startup

ubuntu20にはpython2系が入っていないのでそのまま./chinachu installer するとエラーになる

Installing Node Modules using NPM...

> mirakurun@2.15.2 preinstall /home/rec/chinachu/node_modules/mirakurun
> node bin/preinstall.js

Note: add `-g` to install Mirakurun as Server!

> diskusage@1.1.3 install /home/rec/chinachu/node_modules/diskusage
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 5.4.0-58-generic
gyp ERR! command "/home/rec/chinachu/.nave/installed/10.16.3/bin/node" "/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/rec/chinachu/node_modules/diskusage
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! diskusage@1.1.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the diskusage@1.1.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rec/.npm/_logs/2020-12-20T13_59_12_766Z-debug.log

> diskusage@1.1.3 install /home/rec/chinachu/node_modules/diskusage
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 5.4.0-58-generic
gyp ERR! command "/home/rec/chinachu/.nave/installed/10.16.3/bin/node" "/home/rec/chinachu/.nave/installed/10.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/rec/chinachu/node_modules/diskusage
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! diskusage@1.1.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the diskusage@1.1.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rec/.npm/_logs/2020-12-20T13_59_16_061Z-debug.log
done.

					

pm2でchinachuがerroredになる時の対処法

症状:centos7でchinachu 0.10.0-gamma.0 をインストールした際に errored になり、起動できない
原因:chinachuをインストールする際にnaveもインストールするが、ハッシュ値比較に利用するコマンドがないためインストールに失敗し実行できない。
解決方法:nave.shの中身を書き換える(コマンドを変える)

lqqqqqqqqqqqqqqqqqqqwqqqqwqqqqqqqqqqqqqqqqwqqqqqqwqqqqqqwqqqqqqqqqwqqqqqqqqqwqqqqqqqqwqqqqqwqqqqqqqqqqqqwqqqqqqwqqqqqqqqqqk
x App name          x id x version        x mode x pid  x status  x restart x uptime x cpu x mem        x user x watching x
tqqqqqqqqqqqqqqqqqqqnqqqqnqqqqqqqqqqqqqqqqnqqqqqqnqqqqqqnqqqqqqqqqnqqqqqqqqqnqqqqqqqqnqqqqqnqqqqqqqqqqqqnqqqqqqnqqqqqqqqqqu
x chinachu-operator x 2  x 0.10.0-gamma.0 x fork x N/A  x errored x 0       x 0      x 0%  x 0 B        x root x disabled x
x chinachu-wui      x 1  x 0.10.0-gamma.0 x fork x N/A  x errored x 0       x 0      x 0%  x 0 B        x root x disabled x
x mirakurun-server  x 0  x 2.11.0         x fork x 5892 x online  x 1       x 27m    x 0%  x 148.9 MB   x root x disabled x
mqqqqqqqqqqqqqqqqqqqvqqqqvqqqqqqqqqqqqqqqqvqqqqqqvqqqqqqvqqqqqqqqqvqqqqqqqqqvqqqqqqqqvqqqqqvqqqqqqqqqqqqvqqqqqqvqqqqqqqqqqj
$pm2 log 
 一部抜粋
PM2   | Stopping app:mirakurun-server id:0
PM2   | App [chinachu-wui:1] starting in -fork mode-
PM2   | App [chinachu-wui:1] online
PM2   | Error: spawn .nave/node ENOENT
PM2   |     at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
PM2   |     at onErrorNT (internal/child_process.js:362:16)
PM2   |     at _combinedTickCallback (internal/process/next_tick.js:139:11)
PM2   |     at process._tickDomainCallback (internal/process/next_tick.js:219:9)
PM2   | App [chinachu-operator:2] starting in -fork mode-
PM2   | App [chinachu-operator:2] online
PM2   | Error: spawn .nave/node ENOENT
PM2   |     at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
PM2   |     at onErrorNT (internal/child_process.js:362:16)
PM2   |     at _combinedTickCallback (internal/process/next_tick.js:139:11)
PM2   |     at process._tickDomainCallback (internal/process/next_tick.js:219:9)
PM2   | App [mirakurun-server:0] exited with code [0] via signal [SIGINT]
PM2   | pid=22521 msg=process killed
PM2   | App [mirakurun-server:0] starting in -fork mode-
PM2   | App [mirakurun-server:0] online

3) Node.js Environment の部分で
nave.shが実行出来てないのが原因
nave.sh: line 237: shasum: command not found

nave-2.3.0/nave.sh
removed directory: ‘/home/rec/chinachu/.nave/nave-2.3.0’
######################################################################## 100.0%
/home/rec/chinachu/.nave/nave.sh: line 237: shasum: command not found
shasum mismatch, expect 6c35b85a7cd4188ab7578354277b2b2ca43eacc864a2a16b3669753ec2369d52, got 6c35b85a7cd4188ab7578354277b2b2ca43eacc864a2a16b3669753ec2369d52
$vim chinachu/.nave/nave.sh

#shasum というコマンドはcentosにない
237   local actualshasum=$(sha256sum "$cache/$dir/$base" | awk '{print $1}')
238   if ! [ "$shasum" = "$actualshasum" ]; then

chinachuのソースをいじる
ダウンロードし解凍後
144行目に shasum -a 256 を sha256sum 置換するコマンドを入れる

sed -i -e "s/shasum -a 256/sha256sum/" $NAVE_DIR/nave.sh

#alias sha256sum=’shasum -a 256’でもいいかもしれない…

最終的に下記のようなコードになる

$vim chinachu

140   echo "Installing Node using Nave..."
141   wget -O - https://github.com/isaacs/nave/archive/v2.3.0.tar.gz | tar zxvf - -C $NAVE_DIR nave-2.3.0/nave.sh
142   mv $NAVE_DIR/nave-2.3.0/nave.sh $NAVE_DIR/
143   rm -rfv $NAVE_DIR/nave-2.3.0
144   sed -i -e "s/shasum -a 256/sha256sum/" $NAVE_DIR/nave.sh
145   ${NAVE_DIR}/nave.sh install $NODE_VER
146   rm -fv ${NAVE_DIR}/node
147   ln -sv $NODE_PATH ${NAVE_DIR}/node
148   ln -sv $NPM_PATH ${NAVE_DIR}/npm
$ echo "1" | ./chinachu installer

インストールできる。

CentOS7にPX-Q3PE4のドライバーを入れる

こんなエラーが出る

[root@localhost CentOS7-1804_64bit_kernel3.10.0-862]# insmod tty_Virtual.ko
insmod: ERROR: could not insert module tty_Virtual.ko: File exists
[root@localhost CentOS7-1804_64bit_kernel3.10.0-862]# insmod usb-px4.ko
insmod: ERROR: could not insert module usb-px4.ko: File exists

原因はOSとドライバーのバージョンが違うため
OS側が3.10.0-693に対して、
ドライバー側が3.10.0-862なのが原因

[root@localhost CentOS7-1804_64bit_kernel3.10.0-862]# modinfo tty_Virtual.ko | grep vermagic
vermagic:       3.10.0-862.3.3.el7.x86_64 SMP mod_unload modversions

[root@localhost CentOS7-1804_64bit_kernel3.10.0-862]# uname -r
3.10.0-693.el7.x86_64

OS側と同じバージョンのドライバーを入れる。
公式ページ(http://www.plex-net.co.jp/download/)
ここからダウンロード

# wget http://plex-net.co.jp/plex/linux/CentOS7-1708_64bit_kernel3.10.0-693.zip
# unzip CentOS7-1708_64bit_kernel3.10.0-693.zip
[root@localhost CentOS7-1708_64bit_kernel3.10.0-693]# ll
total 7952
-rw-r--r--. 1 root root  300208 Dec 22  2017 tty_Virtual.ko
-rw-r--r--. 1 root root 7838824 Dec 22  2017 usb-px4.ko
[root@localhost CentOS7-1708_64bit_kernel3.10.0-693]# insmod tty_Virtual.ko
[root@localhost CentOS7-1708_64bit_kernel3.10.0-693]# insmod usb-px4.ko
[root@localhost CentOS7-1708_64bit_kernel3.10.0-693]# lsmod | grep px4
usb_px4               446056  0
tty_Virtual            22223  1 usb_px4
[root@localhost CentOS7-1708_64bit_kernel3.10.0-693]# ls /dev/px4*
/dev/px4-DTV0  /dev/px4-DTV2  /dev/px4-DTV4  /dev/px4-DTV6
/dev/px4-DTV1  /dev/px4-DTV3  /dev/px4-DTV5  /dev/px4-DTV7

めでたしめでたし

CentOS7.5にZFS on Linux を入れる

参考資料
ゼロから CentOS 7 をインストールし ZFS で RAIDZ を使ってみた – Lunasalt.com http://lunasalt.com/?p=5015
RHEL and CentOS · zfsonlinux/zfs Wiki · GitHub https://github.com/zfsonlinux/zfs/wiki/RHEL-and-CentOS

環境

# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)

リポジトリの追加

# yum install http://download.zfsonlinux.org/epel/zfs-release.el7_5.noarch.rpm
Loaded plugins: fastestmirror
zfs-release.el7_5.noarch.rpm                                                                                                | 5.3 kB  00:00:00
Examining /var/tmp/yum-root-BhqdhO/zfs-release.el7_5.noarch.rpm: zfs-release-1-5.el7.centos.noarch
Marking /var/tmp/yum-root-BhqdhO/zfs-release.el7_5.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package zfs-release.noarch 0:1-5.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                         Arch                       Version                            Repository                                     Size
===================================================================================================================================================
Installing:
 zfs-release                     noarch                     1-5.el7.centos                     /zfs-release.el7_5.noarch                     2.9 k

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total size: 2.9 k
Installed size: 2.9 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : zfs-release-1-5.el7.centos.noarch                                                                                               1/1
  Verifying  : zfs-release-1-5.el7.centos.noarch                                                                                               1/1

Installed:
  zfs-release.noarch 0:1-5.el7.centos

Complete!
# yum install zfs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
base                                                                                                                        | 3.6 kB  00:00:00
extras                                                                                                                      | 3.4 kB  00:00:00
updates                                                                                                                     | 3.4 kB  00:00:00
zfs                                                                                                                         | 2.9 kB  00:00:00
(1/5): base/7/x86_64/group_gz                                                                                               | 166 kB  00:00:00
(2/5): extras/7/x86_64/primary_db                                                                                           | 149 kB  00:00:00
(3/5): updates/7/x86_64/primary_db                                                                                          | 2.7 MB  00:00:00
(4/5): base/7/x86_64/primary_db                                                                                             | 5.9 MB  00:00:00
(5/5): zfs/x86_64/primary_db                                                                                                |  12 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package zfs.x86_64 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: zfs-kmod = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: spl = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzpool2 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzfs2 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libuutil1 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libnvpair1 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: sysstat for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzpool.so.2()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzfs_core.so.1()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzfs.so.2()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libuutil.so.1()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libnvpair.so.1()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Running transaction check
---> Package libnvpair1.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package libuutil1.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package libzfs2.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package libzpool2.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package spl.x86_64 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: spl-kmod = 0.7.9 for package: spl-0.7.9-1.el7_5.x86_64
---> Package sysstat.x86_64 0:10.1.5-13.el7 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: sysstat-10.1.5-13.el7.x86_64
---> Package zfs-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.3 for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Processing Dependency: kernel-devel for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Processing Dependency: gcc for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-28.el7_5.1 will be installed
--> Processing Dependency: cpp = 4.8.5-28.el7_5.1 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-28.el7_5.1.x86_64
---> Package kernel-devel.x86_64 0:3.10.0-862.3.3.el7 will be installed
---> Package lm_sensors-libs.x86_64 0:3.4.0-4.20160601gitf9185e5.el7 will be installed
---> Package spl-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.2 for package: spl-dkms-0.7.9-1.el7_5.noarch
---> Package zfs-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.3 for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-28.el7_5.1 will be installed
---> Package glibc-devel.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-222.el7 for package: glibc-devel-2.17-222.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-222.el7.x86_64
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
---> Package spl-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.2 for package: spl-dkms-0.7.9-1.el7_5.noarch
---> Package zfs-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.3 for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-222.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-222.el7.x86_64
---> Package spl-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.2 for package: spl-dkms-0.7.9-1.el7_5.noarch
---> Package zfs-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.3 for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Running transaction check
---> Package kernel-headers.x86_64 0:3.10.0-862.3.3.el7 will be installed
---> Package spl-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.2 for package: spl-dkms-0.7.9-1.el7_5.noarch
---> Package zfs-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.3 for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Finished Dependency Resolution
Error: Package: spl-dkms-0.7.9-1.el7_5.noarch (zfs)
           Requires: dkms >= 2.2.0.2
Error: Package: zfs-dkms-0.7.9-1.el7_5.noarch (zfs)
           Requires: dkms >= 2.2.0.3
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

できない

EPEL追加する

# yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
base                                                                                                                        | 3.6 kB  00:00:00
extras                                                                                                                      | 3.4 kB  00:00:00
updates                                                                                                                     | 3.4 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                                 Arch                              Version                         Repository                         Size
===================================================================================================================================================
Installing:
 epel-release                            noarch                            7-11                            extras                             15 k

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                |  15 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                        1/1
  Verifying  : epel-release-7-11.noarch                                                                                                        1/1

Installed:
  epel-release.noarch 0:7-11

Complete!


# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/epel.repo
# yum --enablerepo=epel install zfs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: mirror.dmmlabs.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package zfs.x86_64 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: zfs-kmod = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: spl = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzpool2 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzfs2 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libuutil1 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libnvpair1 = 0.7.9 for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: sysstat for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzpool.so.2()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzfs_core.so.1()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libzfs.so.2()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libuutil.so.1()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Processing Dependency: libnvpair.so.1()(64bit) for package: zfs-0.7.9-1.el7_5.x86_64
--> Running transaction check
---> Package libnvpair1.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package libuutil1.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package libzfs2.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package libzpool2.x86_64 0:0.7.9-1.el7_5 will be installed
---> Package spl.x86_64 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: spl-kmod = 0.7.9 for package: spl-0.7.9-1.el7_5.x86_64
---> Package sysstat.x86_64 0:10.1.5-13.el7 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: sysstat-10.1.5-13.el7.x86_64
---> Package zfs-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Processing Dependency: dkms >= 2.2.0.3 for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Processing Dependency: kernel-devel for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Processing Dependency: gcc for package: zfs-dkms-0.7.9-1.el7_5.noarch
--> Running transaction check
---> Package dkms.noarch 0:2.6.1-1.el7 will be installed
--> Processing Dependency: elfutils-libelf-devel for package: dkms-2.6.1-1.el7.noarch
---> Package gcc.x86_64 0:4.8.5-28.el7_5.1 will be installed
--> Processing Dependency: cpp = 4.8.5-28.el7_5.1 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-28.el7_5.1.x86_64
---> Package kernel-devel.x86_64 0:3.10.0-862.3.3.el7 will be installed
---> Package lm_sensors-libs.x86_64 0:3.4.0-4.20160601gitf9185e5.el7 will be installed
---> Package spl-dkms.noarch 0:0.7.9-1.el7_5 will be installed
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-28.el7_5.1 will be installed
---> Package elfutils-libelf-devel.x86_64 0:0.170-4.el7 will be installed
--> Processing Dependency: pkgconfig(zlib) for package: elfutils-libelf-devel-0.170-4.el7.x86_64
---> Package glibc-devel.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-222.el7 for package: glibc-devel-2.17-222.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-222.el7.x86_64
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-222.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-222.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-17.el7 will be installed
--> Running transaction check
---> Package kernel-headers.x86_64 0:3.10.0-862.3.3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                                 Arch                     Version                                          Repository                 Size
===================================================================================================================================================
Installing:
 zfs                                     x86_64                   0.7.9-1.el7_5                                    zfs                       413 k
Installing for dependencies:
 cpp                                     x86_64                   4.8.5-28.el7_5.1                                 updates                   5.9 M
 dkms                                    noarch                   2.6.1-1.el7                                      epel                       75 k
 elfutils-libelf-devel                   x86_64                   0.170-4.el7                                      base                       38 k
 gcc                                     x86_64                   4.8.5-28.el7_5.1                                 updates                    16 M
 glibc-devel                             x86_64                   2.17-222.el7                                     base                      1.1 M
 glibc-headers                           x86_64                   2.17-222.el7                                     base                      678 k
 kernel-devel                            x86_64                   3.10.0-862.3.3.el7                               updates                    16 M
 kernel-headers                          x86_64                   3.10.0-862.3.3.el7                               updates                   7.1 M
 libmpc                                  x86_64                   1.0.1-3.el7                                      base                       51 k
 libnvpair1                              x86_64                   0.7.9-1.el7_5                                    zfs                        30 k
 libuutil1                               x86_64                   0.7.9-1.el7_5                                    zfs                        35 k
 libzfs2                                 x86_64                   0.7.9-1.el7_5                                    zfs                       130 k
 libzpool2                               x86_64                   0.7.9-1.el7_5                                    zfs                       591 k
 lm_sensors-libs                         x86_64                   3.4.0-4.20160601gitf9185e5.el7                   base                       41 k
 mpfr                                    x86_64                   3.1.1-4.el7                                      base                      203 k
 spl                                     x86_64                   0.7.9-1.el7_5                                    zfs                        29 k
 spl-dkms                                noarch                   0.7.9-1.el7_5                                    zfs                       456 k
 sysstat                                 x86_64                   10.1.5-13.el7                                    base                      310 k
 zfs-dkms                                noarch                   0.7.9-1.el7_5                                    zfs                       4.9 M
 zlib-devel                              x86_64                   1.2.7-17.el7                                     base                       50 k

Transaction Summary
===================================================================================================================================================
Install  1 Package (+20 Dependent packages)

Total download size: 54 M
Installed size: 128 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/21): elfutils-libelf-devel-0.170-4.el7.x86_64.rpm                                                                        |  38 kB  00:00:00
warning: /var/cache/yum/x86_64/7/epel/packages/dkms-2.6.1-1.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for dkms-2.6.1-1.el7.noarch.rpm is not installed
(2/21): dkms-2.6.1-1.el7.noarch.rpm                                                                                         |  75 kB  00:00:00
(3/21): glibc-headers-2.17-222.el7.x86_64.rpm                                                                               | 678 kB  00:00:00
(4/21): glibc-devel-2.17-222.el7.x86_64.rpm                                                                                 | 1.1 MB  00:00:00
(5/21): cpp-4.8.5-28.el7_5.1.x86_64.rpm                                                                                     | 5.9 MB  00:00:00
(6/21): libmpc-1.0.1-3.el7.x86_64.rpm                                                                                       |  51 kB  00:00:00
(7/21): kernel-headers-3.10.0-862.3.3.el7.x86_64.rpm                                                                        | 7.1 MB  00:00:00
(8/21): gcc-4.8.5-28.el7_5.1.x86_64.rpm                                                                                     |  16 MB  00:00:00
(9/21): libnvpair1-0.7.9-1.el7_5.x86_64.rpm                                                                                 |  30 kB  00:00:00
(10/21): libuutil1-0.7.9-1.el7_5.x86_64.rpm                                                                                 |  35 kB  00:00:00
(11/21): lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm                                                          |  41 kB  00:00:00
(12/21): mpfr-3.1.1-4.el7.x86_64.rpm                                                                                        | 203 kB  00:00:00
(13/21): kernel-devel-3.10.0-862.3.3.el7.x86_64.rpm                                                                         |  16 MB  00:00:01
(14/21): libzfs2-0.7.9-1.el7_5.x86_64.rpm                                                                                   | 130 kB  00:00:00
(15/21): spl-0.7.9-1.el7_5.x86_64.rpm                                                                                       |  29 kB  00:00:00
(16/21): sysstat-10.1.5-13.el7.x86_64.rpm                                                                                   | 310 kB  00:00:00
(17/21): libzpool2-0.7.9-1.el7_5.x86_64.rpm                                                                                 | 591 kB  00:00:01
(18/21): zfs-0.7.9-1.el7_5.x86_64.rpm                                                                                       | 413 kB  00:00:00
(19/21): zlib-devel-1.2.7-17.el7.x86_64.rpm                                                                                 |  50 kB  00:00:00
(20/21): spl-dkms-0.7.9-1.el7_5.noarch.rpm                                                                                  | 456 kB  00:00:01
(21/21): zfs-dkms-0.7.9-1.el7_5.noarch.rpm                                                                                  | 4.9 MB  00:00:01
---------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                               12 MB/s |  54 MB  00:00:04
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libuutil1-0.7.9-1.el7_5.x86_64                                                                                                 1/21
  Installing : libnvpair1-0.7.9-1.el7_5.x86_64                                                                                                2/21
  Installing : mpfr-3.1.1-4.el7.x86_64                                                                                                        3/21
  Installing : kernel-devel-3.10.0-862.3.3.el7.x86_64                                                                                         4/21
  Installing : libmpc-1.0.1-3.el7.x86_64                                                                                                      5/21
  Installing : libzpool2-0.7.9-1.el7_5.x86_64                                                                                                 6/21
  Installing : libzfs2-0.7.9-1.el7_5.x86_64                                                                                                   7/21
  Installing : cpp-4.8.5-28.el7_5.1.x86_64                                                                                                    8/21
  Installing : lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64                                                                          9/21
  Installing : sysstat-10.1.5-13.el7.x86_64                                                                                                  10/21
  Installing : kernel-headers-3.10.0-862.3.3.el7.x86_64                                                                                      11/21
  Installing : glibc-headers-2.17-222.el7.x86_64                                                                                             12/21
  Installing : glibc-devel-2.17-222.el7.x86_64                                                                                               13/21
  Installing : gcc-4.8.5-28.el7_5.1.x86_64                                                                                                   14/21
  Installing : zlib-devel-1.2.7-17.el7.x86_64                                                                                                15/21
  Installing : elfutils-libelf-devel-0.170-4.el7.x86_64                                                                                      16/21
  Installing : dkms-2.6.1-1.el7.noarch                                                                                                       17/21
  Installing : spl-dkms-0.7.9-1.el7_5.noarch                                                                                                 18/21
Loading new spl-0.7.9 DKMS files...
Building for 3.10.0-693.el7.x86_64
Module build for kernel 3.10.0-693.el7.x86_64 was skipped since the
kernel headers for this kernel does not seem to be installed.
  Installing : spl-0.7.9-1.el7_5.x86_64                                                                                                      19/21
  Installing : zfs-dkms-0.7.9-1.el7_5.noarch                                                                                                 20/21
Loading new zfs-0.7.9 DKMS files...
Building for 3.10.0-693.el7.x86_64
Module build for kernel 3.10.0-693.el7.x86_64 was skipped since the
kernel headers for this kernel does not seem to be installed.
  Installing : zfs-0.7.9-1.el7_5.x86_64                                                                                                      21/21
  Verifying  : kernel-devel-3.10.0-862.3.3.el7.x86_64                                                                                         1/21
  Verifying  : spl-dkms-0.7.9-1.el7_5.noarch                                                                                                  2/21
  Verifying  : zlib-devel-1.2.7-17.el7.x86_64                                                                                                 3/21
  Verifying  : glibc-headers-2.17-222.el7.x86_64                                                                                              4/21
  Verifying  : zfs-0.7.9-1.el7_5.x86_64                                                                                                       5/21
  Verifying  : glibc-devel-2.17-222.el7.x86_64                                                                                                6/21
  Verifying  : spl-0.7.9-1.el7_5.x86_64                                                                                                       7/21
  Verifying  : libzfs2-0.7.9-1.el7_5.x86_64                                                                                                   8/21
  Verifying  : kernel-headers-3.10.0-862.3.3.el7.x86_64                                                                                       9/21
  Verifying  : gcc-4.8.5-28.el7_5.1.x86_64                                                                                                   10/21
  Verifying  : cpp-4.8.5-28.el7_5.1.x86_64                                                                                                   11/21
  Verifying  : elfutils-libelf-devel-0.170-4.el7.x86_64                                                                                      12/21
  Verifying  : sysstat-10.1.5-13.el7.x86_64                                                                                                  13/21
  Verifying  : libuutil1-0.7.9-1.el7_5.x86_64                                                                                                14/21
  Verifying  : mpfr-3.1.1-4.el7.x86_64                                                                                                       15/21
  Verifying  : zfs-dkms-0.7.9-1.el7_5.noarch                                                                                                 16/21
  Verifying  : libzpool2-0.7.9-1.el7_5.x86_64                                                                                                17/21
  Verifying  : lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64                                                                         18/21
  Verifying  : libnvpair1-0.7.9-1.el7_5.x86_64                                                                                               19/21
  Verifying  : dkms-2.6.1-1.el7.noarch                                                                                                       20/21
  Verifying  : libmpc-1.0.1-3.el7.x86_64                                                                                                     21/21

Installed:
  zfs.x86_64 0:0.7.9-1.el7_5

Dependency Installed:
  cpp.x86_64 0:4.8.5-28.el7_5.1              dkms.noarch 0:2.6.1-1.el7                                 elfutils-libelf-devel.x86_64 0:0.170-4.el7
  gcc.x86_64 0:4.8.5-28.el7_5.1              glibc-devel.x86_64 0:2.17-222.el7                         glibc-headers.x86_64 0:2.17-222.el7
  kernel-devel.x86_64 0:3.10.0-862.3.3.el7   kernel-headers.x86_64 0:3.10.0-862.3.3.el7                libmpc.x86_64 0:1.0.1-3.el7
  libnvpair1.x86_64 0:0.7.9-1.el7_5          libuutil1.x86_64 0:0.7.9-1.el7_5                          libzfs2.x86_64 0:0.7.9-1.el7_5
  libzpool2.x86_64 0:0.7.9-1.el7_5           lm_sensors-libs.x86_64 0:3.4.0-4.20160601gitf9185e5.el7   mpfr.x86_64 0:3.1.1-4.el7
  spl.x86_64 0:0.7.9-1.el7_5                 spl-dkms.noarch 0:0.7.9-1.el7_5                           sysstat.x86_64 0:10.1.5-13.el7
  zfs-dkms.noarch 0:0.7.9-1.el7_5            zlib-devel.x86_64 0:1.2.7-17.el7

Complete!

# which zpool
/usr/sbin/zpool

入った

[root@localhost ~]# modprobe zfs
modprobe: FATAL: Module zfs not found.

入ってなかった

なんかごちゃごちゃいじってたら動いた…
この辺見てた
FPGAで遊ぶ [CentOS]ZFSインストール成功(7.2) http://bobgosso.blog13.fc2.com/blog-entry-547.html

CentOS7.4 で ZFS な iSCSI ターゲットを作成する – Qiita https://qiita.com/AnaKutsu/items/4094cadbab1bb0596967
多分こんな感じ

#yum groupinstall "Development tools"
#yum --enablerepo=epel reinstall zfs
#reboot
# modprobe zfs
modprobe: FATAL: Module zfs not found.
#yum --enablerepo=epel reinstall zfs
# zpool list
The ZFS modules are not loaded.

# modprobe zfs

# zpool list
no pools available
[root@storage02 ~]# zpool list
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.
[root@storage02 ~]# /sbin/modprobe zfs
[root@storage02 ~]# cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   ramfs
nodev   bdev
nodev   proc
nodev   cgroup
nodev   cpuset
nodev   tmpfs
nodev   devtmpfs
nodev   debugfs
nodev   securityfs
nodev   sockfs
nodev   dax
nodev   pipefs
nodev   anon_inodefs
nodev   configfs
nodev   devpts
nodev   hugetlbfs
nodev   autofs
nodev   pstore
nodev   mqueue
nodev   selinuxfs
        xfs
nodev   binfmt_misc
nodev   zfs

プール作成

[root@storage02 ~]# zpool create tank raidz /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde

見る

[root@storage02 ~]# zpool status
  pool: tank
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sde     ONLINE       0     0     0

errors: No known data errors
[root@storage02 ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   33G  1.6G   31G   5% /
devtmpfs                 1.8G     0  1.8G   0% /dev
tmpfs                    1.9G     0  1.9G   0% /dev/shm
tmpfs                    1.9G  8.8M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sdf1               1014M  181M  834M  18% /boot
tmpfs                    371M     0  371M   0% /run/user/0
tank                      11T  128K   11T   1% /tank

めでたしめでたし

どのSATAポートに繋げたHDDがどこにマウントされてるか調べる方法

最初に全部入れると、どこのSATAポートがどのHDDかいつも忘れるれるのでメモ

インストール

#yum -y install smartmontools

何がマウントされてるか確認

[root@localhost ~]# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdc -d scsi # /dev/sdc, SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
/dev/sde -d scsi # /dev/sde, SCSI device

# smartctl /dev/sda -i
# smartctl /dev/sdb -i
# smartctl /dev/sdc -i
# smartctl /dev/sdd -i
# smartctl /dev/sde -i

sdbに何のHDDが刺さってるか確認
Device ModelとかSerial NumberをHDDに書いてあるシール?と照らし合わせる

# smartctl /dev/sdb -i
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-693.el7.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Toshiba 3.5" MD04ACA... Enterprise HDD
Device Model:     TOSHIBA MD04ACA300
Serial Number:    にゃーん
LU WWN Device Id: にゃーん?
Firmware Version: FP1A
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Jun 25 22:37:08 2018 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

あとは適当にHDD(物理)にマウントポイントをメモ書きしとく

本来SMARTを調べるコマンドなのでもうちょっと使いこなしたい…

【解決】centos7でnodejsを新しく入れようとしても入らない

============================================
追記
yumでのnodejsのバージョンアップにはまった話と解決方法 – Qiita

結論:古いrpmが残っておりそちらが優先されていた

# ll /etc/yum.repos.d/ | grep node
-rw-r--r--  1 root root  472 Jan  5  2018 nodesource-el7.repo
# rm /etc/yum.repos.d/nodesource-el7.repo
rm: remove regular file ‘/etc/yum.repos.d/nodesource-el7.repo’? y
# yum clean all

============================================

入ってないのを確認

[root@10 ~]# yum remove -y nodejs npm
Loaded plugins: fastestmirror
Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration
No Match for argument: nodejs
No Match for argument: npm
No Packages marked for removal

インストール

[root@10 ~]# curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -

## Installing the NodeSource Node.js 8.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m

## Confirming "el7-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_8.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.KfgLZx2d66' 'https://rpm.nodesource.com/pub_8.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.KfgLZx2d66'

## Cleaning up...

+ rm -f '/tmp/tmp.KfgLZx2d66'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `yum install -y nodejs` (as root) to install Node.js 8.x and npm.
## You may also need development tools to build native addons:
##   `yum install -y gcc-c++ make`


[root@10 ~]# yum install -y nodejs
Loaded plugins: fastestmirror
Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 2:6.13.0-1nodesource will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch         Version                       Repository        Size
================================================================================
Installing:
 nodejs       x86_64       2:6.13.0-1nodesource          nodesource        13 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 13 M
Installed size: 38 M
Downloading packages:
nodejs-6.13.0-1nodesource.x86_64.rpm                       |  13 MB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:nodejs-6.13.0-1nodesource.x86_64                           1/1
  Verifying  : 2:nodejs-6.13.0-1nodesource.x86_64                           1/1

Installed:
  nodejs.x86_64 2:6.13.0-1nodesource

Complete!
[root@10 ~]# node -v
v6.13.0

えぇ。。。