RAID6(md)アレイを別のLinuxマシンにマウントする(3/4)

前回の記事の続き、検証3
VM0からVM1にまるごと移行したRAIDアレイの状態確認。

検証の流れ

  1. VM0で構成したRAID6アレイに1MBのダミーファイルを100個生成、MD5とファイルサイズを記録。
  2. VM0を停止しVirtualBoxのマネージャからRAID6のVMディスクx4をVM0から解放し、VM1に追加。
  3. VM1を起動し、RAID構成確認、簡易読み書きテスト、および工程1.とのファイル差分チェック。
  4. (追加検証1) 2.の工程で、VM1に対してVMディスクx4のうち2台のみ追加した時の動作確認と、縮退モードでのアレイ立ち上げ。

VM1を起動、すんなり起動した。
VM0で構成したRAIDアレイは、VM1を起動した段階で既に認識。
ただし、VM0ではmd0として構成したアレイだったが、md127として認識されていて、
State:の項目がactiveからclean
Name:の項目がVM0と同名(これは当然か)、あと(local to host raid-test0)という表記が消えた。

# mdadm --detail /dev/md127
/dev/md127:
Version : 1.2
Creation Time : Wed Feb 25 09:42:40 2015
Raid Level : raid6
Array Size : 16765952 (15.99 GiB 17.17 GB)
Used Dev Size : 8382976 (7.99 GiB 8.58 GB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent

Update Time : Wed Feb 25 09:59:14 2015
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 512K

Name : raid-test0:0
UUID : 5631fad3:0ec41ac1:b6234c79:ab094b44
Events : 19

Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 33 1 active sync /dev/sdc1
2 8 49 2 active sync /dev/sdd1
3 8 65 3 active sync /dev/sde1

cleanの表示が気になったが、mdstatではactiveとなっているため、このままマウントを続行することにした。

# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md127 : active raid6 sdb1[0] sde1[3] sdc1[1] sdd1[2]
16765952 blocks super 1.2 level 6, 512k chunk, algorithm 2 [4/4] [UUUU]

/mnt/md127にマウントしてみる。

# mount -t ext4 /dev/md127 /mnt/md127
#
# df -h
ファイルシス サイズ 使用 残り 使用% マウント位置
/dev/mapper/centos_raid--test1-root 8.5G 1.2G 7.4G 14% /
devtmpfs 492M 0 492M 0% /dev
tmpfs 498M 0 498M 0% /dev/shm
tmpfs 498M 6.6M 491M 2% /run
tmpfs 498M 0 498M 0% /sys/fs/cgroup
/dev/sda1 497M 96M 402M 20% /boot
/dev/md127 16G 1.1G 14G 7% /mnt/md127

無事にマウント出来たので、工程1で取得したファイル差分をチェック。

# ll/ /mnt/md127/
合計 1024016
-rw-r--r--. 1 root root 10485760 2月 25 09:52 file1
-rw-r--r--. 1 root root 10485760 2月 25 09:52 file10
-rw-r--r--. 1 root root 10485760 2月 25 09:52 file100
.....
.....

タイムスタンプ変化無し、ファイル数も100あった。

# find /mnt/md127/ -type f | wc -l
100

MD5値、ファイルサイズも変化無し。

# md5sum /mnt/md127/file*
f1c9645dbc14efddc7d8a322685f26eb /mnt/md127/file1
f1c9645dbc14efddc7d8a322685f26eb /mnt/md127/file100

# du /mnt/md127 -b
16384 /mnt/md0/lost+found
1048596480 /mnt/md127

最後にファイルの読み書きテスト、まず適当にmessagesファイル書き込み

# cp -vp /var/log/messages /mnt/md127/
`/var/log/messages' -> `/mnt/md127/messages'

元ファイルとの差分チェック

# diff /var/log/messages /mnt/md127/messages
#

差分なし、catで表示させてみる。

# cat /mnt/md127/messages
cat /var/log/messages
Feb 25 10:13:16 raid-test1 rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="560" x-info="https://www.rsyslog.com"] start
Feb 25 10:13:06 raid-test1 journal: Runtime journal is using 6.2M (max 49.7M, leaving 74.5M of free 490.9M, current limit 49.7M).
.....
.....

以上で、RAIDアレイ移行の検証は終わり、無事別のLinuxマシンでマウント出来ました。
ただmd127のState:がcleanとなっていて気持ち悪いので、activeへの戻し方をご存知の方がいれば教えてください。
次回の記事は、RAID6アレイを低下モードの状態でマウントする事をやってみます。

Leave a Reply

Your email address will not be published. Required fields are marked *