ReadyNAS Ultra4 Plusに触ってみた その5

ReadyNAS Ultra4 PlusにSSHでログインしてX-RAID2について調べてみたり。

X-RAID2について

ReadyNASで利用されているX-RAID2の正体が気になったので調べてみた。ハードウェアトラブル時に情報が無いと大変かもしれないんで…

とりあえずmountを見てみる

# mount
/dev/md0 on / type ext3 (rw,noatime,nodiratime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /ramfs type ramfs (rw)
tmpfs on /USB type tmpfs (rw,size=16k)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/c/c on /c type ext4 (rw,noatime,nodiratime,acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv1)
nfsd on /proc/fs/nfsd type nfsd (rw)
configfs on /sys/kernel/config type configfs (rw)

どうも/dev/md0が/、/dev/c/cが/cとして利用されている模様。
続いてfdiskしてみると、

# fdisk -l
Found valid GPT with protective MBR; using GPT

Disk /dev/sda: 3907029168 sectors, 1863G
Logical sector size: 512
Disk identifier (GUID): 95ba255a-1f36-4ad9-99c0-297f0f4b588f
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3907029134

Number  Start (sector)    End (sector)  Size       Code  Name
   1              64         8388671       4096M   0700
   2         8388672         9437247        512M   0700
   3         9437248      3907025072       1858G   0700
Found valid GPT with protective MBR; using GPT

Disk /dev/sdb: 3907029168 sectors, 1863G
Logical sector size: 512
Disk identifier (GUID): 79ff5f4f-7936-42d2-b091-1f626d511d37
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3907029134

Number  Start (sector)    End (sector)  Size       Code  Name
   1              64         8388671       4096M   0700
   2         8388672         9437247        512M   0700
   3         9437248      3907025072       1858G   0700
Found valid GPT with protective MBR; using GPT

Disk /dev/sdc: 3907029168 sectors, 1863G
Logical sector size: 512
Disk identifier (GUID): ef66ffd1-60bc-42dc-8fe2-6a5b38e08ca3
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3907029134

Number  Start (sector)    End (sector)  Size       Code  Name
   1              64         8388671       4096M   0700
   2         8388672         9437247        512M   0700
   3         9437248      3907025072       1858G   0700
Found valid GPT with protective MBR; using GPT

Disk /dev/sdd: 3907029168 sectors, 1863G
Logical sector size: 512
Disk identifier (GUID): 456a7d36-567c-4a88-85aa-2e668bf0a9af
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3907029134

Number  Start (sector)    End (sector)  Size       Code  Name
   1              64         8388671       4096M   0700
   2         8388672         9437247        512M   0700
   3         9437248      3907025072       1858G   0700

Disk /dev/md0: 4293 MB, 4293906432 bytes
2 heads, 4 sectors/track, 1048317 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/dm-0: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

また、/proc/mdstatを見てみる

# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md2 : active raid5 sda3[0] sdd3[3] sdc3[2] sdb3[1]
      5846378112 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

md1 : active raid6 sda2[0] sdd2[3] sdc2[2] sdb2[1]
      1048448 blocks super 1.2 level 6, 64k chunk, algorithm 2 [4/4] [UUUU]

md0 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      4193268 blocks super 1.2 [4/4] [UUUU]

unused devices: <none>

どうやらsda~sddまでの4台のHDDはそれぞれ3つのパーティションに区切られて、sdX1が4GB、sdX2が512MB、sdX3が残りの1858GBとなっている。
そのsdX1を合わせてRAID 1のmd0、sdX2を合わせてRAID 6のmd1、sdX3を合わせてRAID5のmd2が作成されているのが分かる。
md0はext3でフォーマットされ、/としてマウントされているが、他のmd1、md2はどうなっているのだろうか?

md1はスワップ領域になっているような気がするので、確認してみる。

# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/md1                                partition       1048444 16548   -1

予想通りmd1はスワップ領域になっていた。残るmd2はどうなっているのだろう、おそらく/c以下としてマウントされている/dev/c/cだろう。
LVMだろうと予測して調べてみる

# lvdisplay /dev/c
  --- Logical volume ---
  LV Name                /dev/c/c
  VG Name                c
  LV UUID                TgQaKH-ZY82-1GEz-omL9-ECmt-zKWs-JtLNFu
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                5.44 TB
  Current LE             89048
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0
# vgdisplay
  --- Volume group ---
  VG Name               c
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  12
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               5.44 TB
  PE Size               64.00 MB
  Total PE              89208
  Alloc PE / Size       89048 / 5.44 TB
  Free  PE / Size       160 / 10.00 GB
  VG UUID               yuglsp-SpfU-1Lo5-MZXv-2Tmm-dhwV-l7A5Qc
# pvdisplay -C
  PV         VG   Fmt  Attr PSize PFree
  /dev/md2   c    lvm2 a-   5.44T 10.00G

結果、md2はLVMで論理ボリューム/dev/cとして抽象化されているのが分かる。
今回は2TBのHDDを最初から取り付けていたため、LVMを利用している意味が感じられないが、HDDを徐々に増やしたりする場合にはこの方法だとデータを保持したまま容量を増やしてくのに便利なのだろう。
次にReadyNASを扱う機会があれば確認してみたい。

あとはNFSでのベンチマークとUPSの扱いについて。
あとSNMP。

ReadyNAS Ultra4 Plusに触ってみた その6

ReadyNAS Ultra4 PlusでSNMPを使ってみる。

本来、ストレージとしての選定理由の一つにSNMPが使えることを入れていたので、標準でSNMPが使えなかったのは予想外だった。
調べてみるとReadyNAS Proでは対応しているが、コンシューマ向けモデルでは対応してない模様。
使えないと致命的な訳では無いが、使えると便利なのでなんとかならないか調べてみる。

Webユーザインターフェイスの設定画面では項目が無いためどうしようも無いが、rootを取ってSSHでログインしてみるとSNMPが導入済みのように見える。

# /etc/init.d/snmpd start

でsnmpdを起動して、リモートサーバからsnmpwalkで確認してみる。

# snmpwalk -v 1 -c public  192.168.101.201
SNMPv2-MIB::sysDescr.0 = STRING: Linux nas-C1-28-9A 2.6.37.6.RNx86_64.2.1 #1 SMP Mon Aug 15 16:19:41 PDT 2011 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (71936062) 8 days, 7:49:20.62
SNMPv2-MIB::sysContact.0 = STRING: root
SNMPv2-MIB::sysName.0 = STRING: nas-C1-28-9A
SNMPv2-MIB::sysLocation.0 = STRING: Unknown
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (1) 0:00:00.01
(略)

無事にSNMPで監視できそう。

ReadyNASの再起動時に自動的にsnmpdが起動するように設定しておく。

# update-rc.d snmpd defaults
 Adding system startup for /etc/init.d/snmpd ...
   /etc/rc0.d/K20snmpd -> ../init.d/snmpd
   /etc/rc1.d/K20snmpd -> ../init.d/snmpd
   /etc/rc6.d/K20snmpd -> ../init.d/snmpd
   /etc/rc2.d/S20snmpd -> ../init.d/snmpd
   /etc/rc3.d/S20snmpd -> ../init.d/snmpd
   /etc/rc4.d/S20snmpd -> ../init.d/snmpd
   /etc/rc5.d/S20snmpd -> ../init.d/snmpd

ReadyNAS固有の情報でどのようなものが取得できるか確認するため、ReadyNAS Communityに置いてあるREADYNAS-MIB.txtを確認する。

$ snmpwalk -v 2c -c public 192.168.101.201 1.3.6.1.4.1.4526.18
SNMPv2-SMI::enterprises.4526.18.1.0 = STRING: "Seagate ST2000DL003-9VT166 1863 GB"
SNMPv2-SMI::enterprises.4526.18.3.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4526.18.3.1.1.2 = INTEGER: 2
SNMPv2-SMI::enterprises.4526.18.3.1.1.3 = INTEGER: 3
SNMPv2-SMI::enterprises.4526.18.3.1.1.4 = INTEGER: 4
SNMPv2-SMI::enterprises.4526.18.3.1.2.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4526.18.3.1.2.2 = INTEGER: 2
SNMPv2-SMI::enterprises.4526.18.3.1.2.3 = INTEGER: 3
SNMPv2-SMI::enterprises.4526.18.3.1.2.4 = INTEGER: 4
SNMPv2-SMI::enterprises.4526.18.3.1.3.1 = STRING: "Seagate ST2000DL003-9VT166 1863 GB"
SNMPv2-SMI::enterprises.4526.18.3.1.3.2 = STRING: "Seagate ST2000DL003-9VT166 1863 GB"
SNMPv2-SMI::enterprises.4526.18.3.1.3.3 = STRING: "Seagate ST2000DL003-9VT166 1863 GB"
SNMPv2-SMI::enterprises.4526.18.3.1.3.4 = STRING: "Seagate ST2000DL003-9VT166 1863 GB"
SNMPv2-SMI::enterprises.4526.18.3.1.4.1 = STRING: "ok"
SNMPv2-SMI::enterprises.4526.18.3.1.4.2 = STRING: "ok"
SNMPv2-SMI::enterprises.4526.18.3.1.4.3 = STRING: "ok"
SNMPv2-SMI::enterprises.4526.18.3.1.4.4 = STRING: "ok"
SNMPv2-SMI::enterprises.4526.18.3.1.5.1 = INTEGER: 78
SNMPv2-SMI::enterprises.4526.18.3.1.5.2 = INTEGER: 82
SNMPv2-SMI::enterprises.4526.18.3.1.5.3 = INTEGER: 80
SNMPv2-SMI::enterprises.4526.18.3.1.5.4 = INTEGER: 78
SNMPv2-SMI::enterprises.4526.18.4.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4526.18.4.1.2.1 = INTEGER: 1691
SNMPv2-SMI::enterprises.4526.18.4.1.3.1 = STRING: "SYS"
SNMPv2-SMI::enterprises.4526.18.5.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4526.18.5.1.1.2 = INTEGER: 2
SNMPv2-SMI::enterprises.4526.18.5.1.2.1 = INTEGER: 53
SNMPv2-SMI::enterprises.4526.18.5.1.2.2 = INTEGER: 73
SNMPv2-SMI::enterprises.4526.18.5.1.3.1 = STRING: "ok"
SNMPv2-SMI::enterprises.4526.18.5.1.3.2 = STRING: "ok"
SNMPv2-SMI::enterprises.4526.18.7.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4526.18.7.1.2.1 = STRING: "Volume C"
SNMPv2-SMI::enterprises.4526.18.7.1.3.1 = STRING: "RAID Level X2"
SNMPv2-SMI::enterprises.4526.18.7.1.4.1 = STRING: "ok"
SNMPv2-SMI::enterprises.4526.18.7.1.5.1 = INTEGER: 5676032
SNMPv2-SMI::enterprises.4526.18.7.1.6.1 = INTEGER: 5409792

何度か試してみるとenterprises.4526.18.1.0の項目が化けることがあり、上記の結果でも正常な値が表示されていない。おそらくバグと思われる。

監視サーバからCactiで監視してみる。
設定は他のsnmpdの動作しているサーバと同様なので省略。表示すると以下のようになる。
f:id:papillon326:20120325155612j:plain

温度の項目は通常だと取れないが、Cactiの公式フォーラムから拾ってきたテンプレートを導入して表示している。

温度の項目だけを拡大すると以下のような感じになる。
f:id:papillon326:20120325160233j:plain

SNMPトラップについては省略。