◆ioDriveを買ったら…何をしたらいいの?を整理しました。
FusionIO社の ioDrive は、NAND型高速半導体ストレージ(「SSDじゃないんです」by 中の人@neofact さん)。一部界隈で速さと低レイテンシで、ナウなヤングにバカウケなブツでございます。左の写真は、ioDrive 320GB SLC ( Single Level Cell ) というタイプ。
もし、ある日突然、道端に落ちていたり(拾得物は、ちゃんと交番に届けましょう)、空から青白い光を放ちながら降ってきたり、サンタさんがプレゼントしてくれた時に(いや、それは無い)どうしたらよいのか、そんな時の為に、セットアップ手順を7つにまとめてみました。
ちなみに、ioDrive って何?どんな性能なの?という所に興味がありましたら、こちらのスライドをご覧下さい。
なお、以下の手順では Red Hat Enterprise Linux 6.x の場合を元にしています。ですが、基本的に Linux 系であれば、同様の操作でセットアップ可能と思います。本手順では、ドライバの認識とパーティションをマウントするまでを整理しました。
◆1. 「 マシンに ioDrive を取り付け 」
なにはともあれ、まずは本体に ioDrive を装着しましょう。取り扱いは慎重に。間違っても素手で取り扱うのは厳禁です!静電気怖いです(;´Д`)
◆2.「 ioDrive のドライバとファームウェアを入手 」
次に、環境に応じた最新のドライバ・ファームウェアを入手します。
http://support.fusionio.com/driver/
※未登録の場合は、画面右上の Register With Fusion-io から登録を行い、ログインします。
URL にアクセスすると、選択肢が出てきます。製品・バージョン・OSを選びます。RHEL6 の場合、Select Product は【 ioDrive 】、Select Version は【 r2.3.1 】、Operation System は 【 Linux_rhel-6 】 を選択します(2011年12月現在)。
ちなみに、対応しているOS情報を参照しますと、このバージョンでは
- Red Hat Enterprise Linux 4,5,6
- CentOS 4,5
- Fedora 13
- Debian Lenny, Squeeze
- OpenSUSE 11
- SUSE Linux Enterprise Server
- Ubuntu 8.04, 9.10, 10.04, 10.10
- Solaris 10
- Chaos 4.3
- OEL 5
- VMware ESX 4.0, 4.1, ESXi 4.1, 5.0
- Windows
以上の対応ドライバおよびドキュメント類が公開されています。OS 等を選択した後は、ドキュメントやドライバ類をダウンロードします。
いくつかドキュメント類がありますが、ハードウェア・ユーザ・ガイド(ioDrive_Hardware_UserGuide_2.3.1.pdf)と、ユーザガイド(ioDrive_UserGuide_Linux_2.3.1.pdf)は必ず読むべきです。特にユーザガイドは、各種コマンド等の詳細情報が記述されています。私自身、セットアップのときは非常に助かりました。
あとは ioMemory VSL ( iomemory-vsl-2.3.1.123-1.0.el6.src.rpm ) と、fio-から始まる RPM パッケージ群と、最新ファームウェア fio-firmware-10197.4-1.0.noarch.rpm をダウンロードします。ioManager は GUI 用のツールですが、普段リモートからコマンドラインでしか操作しないのであれば、こちらは不要でしょう。必要に応じて入れてください。
◆3. 「 ioMemory VLS ドライバ用パッケージのリビルド」
ioDrive を使うには、専用のデバイスドライバ “ioMemory VLS” の組み込みを行います。先ほどダウンロードした iomemory-vsl-~.rpm をサーバに展開します。展開後、fio-driver.spec というRPM パッケージをリビルドします。
# rpm -ivh iomemory-vsl-2.3.1.123-1.0.el6.src.rpm 1:iomemory-vsl ########################################### [100%] # cd /root/rpmbuild/SPECS/ # rpmbuild -bb fio-driver.spec 実行中(%prep): /bin/sh -e /var/tmp/rpm-tmp.DteQ5Y + umask 022 + cd /root/rpmbuild/BUILD (略) 書き込み完了: /root/rpmbuild/RPMS/x86_64/iomemory-vsl-source-2.3.1.123-1.0.el6.x86_64.rpm 実行中(%clean): /bin/sh -e /var/tmp/rpm-tmp.KfhcJ6 + umask 022 + cd /root/rpmbuild/BUILD + cd iomemory-vsl-2.3.1.123 + /bin/rm -rf /root/rpmbuild/BUILDROOT/iomemory-vsl-2.3.1.123-1.0.el6.x86_64 + exit 0
正常に完了しますと、次のようにパッケージ群が生成されていると思います。
# cd ../RPMS/x86_64/ # ls -al 合計 3044 drwxr-xr-x 2 root root 4096 8月 10 13:31 2011 . drwxr-xr-x 3 root root 4096 8月 10 13:31 2011 .. -rw-r--r-- 1 root root 910392 8月 10 13:31 2011 iomemory-vsl-2.6.32-71.18.2.el6.x86_64-2.3.1.123-1.0.el6.x86_64.rpm -rw-r--r-- 1 root root 5560 8月 10 13:31 2011 iomemory-vsl-config-2.6.32-71.18.2.el6.x86_64-2.3.1.123-1.0.el6.x86_64.rpm -rw-r--r-- 1 root root 2175236 8月 10 13:31 2011 iomemory-vsl-source-2.3.1.123-1.0.el6.x86_64.rpm
RPM パッケージ組み込みの前に、依存性・整合性をチェックします。
# rpm -ivh --test iomemory-vsl-2.6.32-71.18.2.el6.x86_64-2.3.1.123-1.0.el6.x86_64.rpm 準備中... ########################################### [100%]
エラーが無ければ、まとめて RPM パッケージをインストールします。
# rpm -ivh iomemory*.rpm 準備中... ########################################### [100%] 1:iomemory-vsl-source ########################################### [ 33%] 2:iomemory-vsl-config-2.6########################################### [ 67%] 3:iomemory-vsl-2.6.32-71.########################################### [100%]
エラーが何にも出なければ、完了です。
◆4. 「 ユーティリティのインストール 」
ioDrive にはユーティリティ・ツールが付属しています。fio-で始まるコマンド群を使い、ioDrive のステータスを表示したり、ファームウェアのバージョンアップや、 raw フォーマットを行う事が出来ます。先ほどダウンロードした RPM を、サクッとまとめてインストールして構いません。
# rpm -ivh *.rpm 準備中... ########################################### [100%] 1:libfio ########################################### [ 11%] 2:fio-common ########################################### [ 22%] 3:fio-util ########################################### [ 33%] 4:fio-sysvinit ########################################### [ 44%] 5:fio-snmp-agentx ########################################### [ 56%] 6:fio-smis ########################################### [ 67%] 7:libfusionjni ########################################### [ 78%] 8:fio-snmp-mib ########################################### [ 89%] 9:fio-remote-util ########################################### [100%]
なお、インストール後のファイルは、それぞれ次のディレクトリに展開されます。
- Drivers (ドライバ関連) … /lib/modules/<kernel-version>/extra/fio/iomemory-vsl.ko
- Utilities (コマンドツール) … /usr/bin/
- ファームウェア … /usr/share/fio/firmware
- SNMP MIB … /usr/share/fio/mib
◆5. デバイスドライバ(ioMemory VSL)の組み込み
デバイスドライバを有効にします。サクッとコマンドを実行するだけで OK です。
# modprobe iomemory-vsl
ちなみに、サーバ起動時には iomemory-vsl という起動スクリプトが自動実行されるようになっています。
# /sbin/chkconfig --list iomemory-vsl iomemory-vsl 0:off 1:off 2:on 3:on 4:on 5:on 6:off
なお、正常にデバイスの認識が成功すると、ioDrive カードにつけられている LED が、赤色から緑色に変化します。正常に認識されているかどうかを調べるには、【 fio-pci-check 】コマンドを実行します。
# fio-pci-check Root Bridge PCIe 4000 MB/sec needed max Bridge 00:07.00 (1a-1e) Needed 1000 MB/sec Avail 1000 MB/sec ioDrive 1a:00.0 Firmware 36867
また、コマンドラインでは 【 fio-status 】コマンドによって、正常に認識されているかどうか確認することが出来ます。
# fio-status Unable to get product information for /dev/fct0:0. Unable to get format information for /dev/fct0. Unable to get data volume information for /dev/fct0. Unable to get system monitor information for /dev/fct0. Found 1 ioDrive in this system Fusion-io driver version: 2.3.1 build 123 Adapter: ioDrive Low-Profile ioDIMM Adapter SN:19756 External Power: NOT connected Sufficient power available: Unknown Connected ioDimm module: fct0: IBM ioDIMM 320GB SN:19196 fct0 Status unknown: Driver is in MINIMAL MODE: Firmware is out of date. Update firmware. IBM ioDIMM 320GB SN:19196 PCI:09:00.0 Firmware v3.0.0, rev 36867 Geometry and capacity information not available. Sufficient power available: Unknown Internal temperature: 50.7 degC, max 50.7 degC
このように、メーカや容量、認識されているデバイス(ioDriveの物理領域は /dev/fct0 として見えます)や温度など詳細情報が表示されます。【 fio-status –all 】と実行すると、PCI バスの電源供給状況等、より詳細な情報が表示されます。
# fio-status --all Unable to get product information for /dev/fct0:0. Unable to get format information for /dev/fct0. Unable to get data volume information for /dev/fct0. Unable to get system monitor information for /dev/fct0. Found 1 ioDrive in this system Fusion-io driver version: 2.3.1 build 123 Adapter: ioDrive Low-Profile ioDIMM Adapter SN:19756 Low-Profile ioDIMM Adapter, PN:00119200007, Mfr:004, Date:20091023 External Power: NOT connected Powerloss protection: not available PCIE Bus voltage: avg 12.14V, min 12.12V, max 12.29V PCIE Bus current: avg 0.00A, max 0.57A PCIE Bus power: avg 0.00W, max 0.00W PCIE slot available power: unavailable Sufficient power available: Unknown PCIE negotiated link: 4 lanes at 2.50 Gbits/sec each, 1000 MBytes/sec total Connected ioDimm module: fct0: IBM ioDIMM 320GB SN:19196 fct0 Status unknown: Driver is in MINIMAL MODE: Firmware is out of date. Update firmware. IBM ioDIMM 320GB SN:19196 IBM ioDIMM 320GB, PN:00201001201, Mfr:004, Date:20091023 Powerloss protection: not available PCI:09:00.0 Vendor:1aed, Device:1005, Sub vendor:1014, Sub device:03c3 Firmware v3.0.0, rev 36867 Geometry and capacity information not available. FPGA ID:0 Format UID:000000004afc0132908f002fec23c400 PCIE slot available power: unavailable Sufficient power available: Unknown PCIE negotiated link: 4 lanes at 2.50 Gbits/sec each, 1000 MBytes/sec total Internal temperature: 50.2 degC, max 50.7 degC Board temperature: 0 degC Internal voltage: avg 0.999V, max 0.999V Aux voltage: avg 2.484V, max 2.484V
◆6.「ファームウェアのバージョンアップ」
ioDrive のファームウェアのバージョンが古い場合は、最新のものへとバージョンアップします。バージョンアップ前に、【 fio-detach 】コマンドで、一旦デバイスを切り離します。
# fio-detach /dev/fct0 Detaching: [====================] (100%) /
正常に取り外した後、【 fio-update-iodrive 】コマンドで、ファームウェアのバージョンアップを行います。
# fio-update-iodrive /usr/share/fio/firmware/iodrive_101971_4.fff Device ID 0 (/dev/fct0) Updating device firmware from 3.0.0.36867 to 5.0.7.101971 WARNING: DO NOT TURN OFF POWER OR RUN ANY IODRIVE UTILITIES WHILE THE FIRMWARE UPDATE IS IN PROGRESS Please wait...this could take a while Progress ------------------------- / 0: 3% (この間、約7分) Progress ------------------------- | 0: 100% Results ------------------------- 0: Firmware updated successfully You MUST now reboot this machine before the new firmware will be activated!
最後に、サーバの再起動をかけると、新しいファームウェアが有効になります。
◆7.「フォーマットとマウント」
ここまで来たら、あとはもうフォーマットするだけです。まずは ioDrive に raw フォーマットをかけます。
# fio-detach /dev/fct0 Detaching: [====================] (100%) / # fio-format /dev/fct0 Creating a standard block device of size 322.55GBytes (300.40GiBytes). Using block (sector) size of 512 bytes. WARNING: Formatting will destroy any existing data on the device! Do you wish to continue [y/n]? y Formatting: [====================] (100%) Format successful. # fio-attach /dev/fct0 Attaching: [====================] (100%) \ fioa
一般的な環境であれば、ioDrive の領域は「 /dev/fioa 」として認識されます。2枚差しの場合、2枚目は「 /dev/fiob 」として認識されます。
以下、通常のハードディスクと同様に論理フォーマットやマウントするだけで、ioDrive が使えます。【 fdisk 】コマンドで、パーティションを切ります。
# fdisk /dev/fioa デバイスは正常な DOS 領域テーブルも、Sun, SGI や OSF ディスクラベルも 含んでいません 新たに DOS ディスクラベルをディスク識別子 0x452a8e56 で作成します。 あなたが書き込みを決定するまで、変更はメモリ内だけに残します。 その後はもちろん以前の内容は修復不可能になります。 警告: 領域テーブル 4 の不正なフラグ 0x0000 は w(書き込み)によって 正常になります 警告: DOS互換モードは廃止予定です。このモード (コマンド 'c') を止めることを 強く推奨します。 and change display units to sectors (command 'u'). コマンド (m でヘルプ): n
【 n 】新規パーティション→【 p 】基本パーティションを選び、必要に応じて領域を分割します。最後に【 w 】で、パーティション情報を書き込みます。
パーティション番号 (1-4): 1 最初 シリンダ (1-39214, 初期値 1): 初期値 1 を使います Last シリンダ, +シリンダ数 or +size{K,M,G} (1-39214, 初期値 39214): 初期値 39214 を使います コマンド (m でヘルプ): p ディスク /dev/fioa: 322.6 GB, 322553184256 バイト ヘッド 255, セクタ 63, シリンダ 39214 Units = シリンダ数 of 16065 * 512 = 8225280 バイト セクタサイズ (論理 / 物理): 512 バイト / 512 バイト I/O size (minimum/optimal): 512 bytes / 32768 bytes ディスク識別子: 0x452a8e56 デバイス ブート 始点 終点 ブロック Id システム /dev/fioa1 1 39214 314986423+ 83 Linux コマンド (m でヘルプ): w パーティションテーブルは変更されました! ioctl() を呼び出してパーティションテーブルを再読込みします。 ディスクを同期しています。
コマンドを実行し終わると、/proc/partitions に論理領域 /dev/fioa1 が見えます。
# cat /proc/partitions major minor #blocks name 8 16 142577664 sdb 8 48 194335744 sdd 8 32 194335744 sdc 8 0 142577664 sda 8 1 987966 sda1 8 2 139628947 sda2 8 3 1959930 sda3 252 0 314993344 fioa 252 1 314986423 fioa1
最後に、【 mkfs.ext4 】コマンドで、さくっとフォーマットかけます。
# /sbin/mkfs.ext4 /dev/fioa1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=8 blocks 19693568 inodes, 78746605 blocks 3937330 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 2404 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done
あとは、マウントコマンドでマウント可能です。
# mount /dev/fioa1 /mnt
df コマンドを実行すると、マウントされている事が確認できるはずです。
# df -T Filesystem Type 1K-ブロック 使用 使用可 使用% マウント位置 /dev/sda2 ext4 137436648 3872564 126582640 3% / tmpfs tmpfs 132316884 0 132316884 0% /dev/shm /dev/sda1 ext4 972404 358144 564864 39% /boot /dev/fioa1 ext4 310042436 199436 294093680 1% /mnt
必要に応じて、/etc/fstab にエントリを追加しておいてもいいですね。
/dev/fioa1 /fioa ext4 defaults 1 2
如何でしたか?これで、いつ ioDrive が手許に届いても、すぐに使えますねp(^^)q
もしもの時のお役に立てば幸いです。
※参照:”ioDrive User Guide for Driver Release 2.3.1 – Linux” (http://support.fusionio.com/driver/ で配付されているioDrive_UserGuide_Linux_2.3.1.pdf )