RAID 5アレイをRAID 6アレイに変更するコマンドの例
「RAID 5」アレイを「RAID 6」アレイに変更するコマンドの例です。この操作は「アレイの再形成」に該当します。
環境について
「RAID 5」アレイの作成については、以下を参考にしてください。ポイント
このRAIDレベルの変更におけるポイントです。「RAID 6」アレイは、2種類のパリティーブロックで冗長性を提供するアレイです。
従って物理ボリュームを1つ追加する必要があります。
事前に物理ボリュームを用意しておきましょう。
追加する物理ボリュームは、事前に「スペアディスク」として追加しておくと良いです。
1.論理ボリュームの確認
比較のため現状の論理ボリュームの情報を確認します。「RAID 5」アレイであることが分かります。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --detail /dev/md/RAID5Array
/dev/md/RAID5Array:
Version : 1.2
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 102272 (99.89 MiB 104.73 MB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Fri May 9 12:54:32 2014
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Events : 18
Number Major Minor RaidDevice State
0 8 52 0 active sync /dev/sdd4
1 8 68 1 active sync /dev/sde4
3 8 84 2 active sync /dev/sdf4
/dev/md/RAID5Array:
Version : 1.2
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 102272 (99.89 MiB 104.73 MB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Fri May 9 12:54:32 2014
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Events : 18
Number Major Minor RaidDevice State
0 8 52 0 active sync /dev/sdd4
1 8 68 1 active sync /dev/sde4
3 8 84 2 active sync /dev/sdf4
2.物理ボリュームの確認
物理ボリュームの情報を確認します。「RAID 5」アレイであることが分かります。
/dev/sdd4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdd4
/dev/sdd4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 6b9a0229:e3beccf4:181aeb72:a9289a8f
Update Time : Fri May 9 12:54:32 2014
Checksum : 3b269f30 - correct
Events : 18
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAA ('A' == active, '.' == missing)
/dev/sdd4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 6b9a0229:e3beccf4:181aeb72:a9289a8f
Update Time : Fri May 9 12:54:32 2014
Checksum : 3b269f30 - correct
Events : 18
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAA ('A' == active, '.' == missing)
/dev/sde4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sde4
/dev/sde4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 73924a60:85f338d9:272425fe:b4d398ff
Update Time : Fri May 9 12:54:32 2014
Checksum : 521380f6 - correct
Events : 18
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAA ('A' == active, '.' == missing)
/dev/sde4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 73924a60:85f338d9:272425fe:b4d398ff
Update Time : Fri May 9 12:54:32 2014
Checksum : 521380f6 - correct
Events : 18
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAA ('A' == active, '.' == missing)
/dev/sdf4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdf4
/dev/sdf4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 0fe61184:3ddbcac7:723c0e6d:e652c28f
Update Time : Fri May 9 12:54:32 2014
Checksum : 637f53c8 - correct
Events : 18
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAA ('A' == active, '.' == missing)
/dev/sdf4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : de4c25d7:732c5bd1:c1b29296:45af298a
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 12:54:27 2014
Raid Level : raid5
Raid Devices : 3
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 0fe61184:3ddbcac7:723c0e6d:e652c28f
Update Time : Fri May 9 12:54:32 2014
Checksum : 637f53c8 - correct
Events : 18
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAA ('A' == active, '.' == missing)
3.スペアディスクを追加する
「スペアディスク」を追加します。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --add /dev/md/RAID5Array /dev/sdg4
mdadm: added /dev/sdg4
mdadm: added /dev/sdg4
4.スペアディスクの確認
「スペアディスク」を確認するため、論理ボリュームの情報を表示します。「/dev/sdg4」が「スペアディスク」として追加されています。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --detail /dev/md/RAID5Array
/dev/md/RAID5Array:
Version : 1.2
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid5
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 102272 (99.89 MiB 104.73 MB)
Raid Devices : 3
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Fri May 9 20:22:33 2014
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Events : 19
Number Major Minor RaidDevice State
0 8 52 0 active sync /dev/sdd4
1 8 68 1 active sync /dev/sde4
3 8 84 2 active sync /dev/sdf4
4 8 100 - spare /dev/sdg4
/dev/md/RAID5Array:
Version : 1.2
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid5
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 102272 (99.89 MiB 104.73 MB)
Raid Devices : 3
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Fri May 9 20:22:33 2014
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Events : 19
Number Major Minor RaidDevice State
0 8 52 0 active sync /dev/sdd4
1 8 68 1 active sync /dev/sde4
3 8 84 2 active sync /dev/sdf4
4 8 100 - spare /dev/sdg4
5.RAIDレベルを変更する
以下のコマンドを実行し、「RAID 6」アレイに変更します。コマンドやオプションの説明は「アレイのRAIDレベルを変更するコマンドの説明」を参考にしてください。
sudo mdadm --grow /dev/md/RAID5Array --level=raid6 --backup-file=/root/RAID5ArrayBackup.reshape
6.コマンドの実行結果
以下のようにコマンドの実行結果が表示されます。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --grow /dev/md/RAID5Array --level=raid6 --backup-file=/root/RAID5ArrayBackup.reshape
mdadm: level of /dev/md/RAID5Array changed to raid6
mdadm: level of /dev/md/RAID5Array changed to raid6
7.論理ボリュームの確認
論理ボリュームの情報を確認します。以下のことが分かります。
- RAID 6アレイである
- 物理ボリューム数(アレイのスロット数)が1つ増え、4つになっている
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --detail /dev/md/RAID5Array/dev/md/RAID5Array:
Version : 1.2
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 102272 (99.89 MiB 104.73 MB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Fri May 9 20:30:51 2014
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Events : 270
Number Major Minor RaidDevice State
0 8 52 0 active sync /dev/sdd4
1 8 68 1 active sync /dev/sde4
3 8 84 2 active sync /dev/sdf4
4 8 100 3 active sync /dev/sdg4
Version : 1.2
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 102272 (99.89 MiB 104.73 MB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Fri May 9 20:30:51 2014
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Events : 270
Number Major Minor RaidDevice State
0 8 52 0 active sync /dev/sdd4
1 8 68 1 active sync /dev/sde4
3 8 84 2 active sync /dev/sdf4
4 8 100 3 active sync /dev/sdg4
8.物理ボリュームの確認
物理ボリュームの情報を確認します。「RAID 6」アレイであることが分かります。
/dev/sdd4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdd4
/dev/sdd4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 91c35559:d4d0e461:c374a2ab:a578cc5e
Update Time : Fri May 9 20:30:51 2014
Checksum : a2463dd8 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdd4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 91c35559:d4d0e461:c374a2ab:a578cc5e
Update Time : Fri May 9 20:30:51 2014
Checksum : a2463dd8 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAAA ('A' == active, '.' == missing)
/dev/sde4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sde4
/dev/sde4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 75dbad04:d4fb7f9b:0491f141:b74b4c9a
Update Time : Fri May 9 20:30:51 2014
Checksum : 59087010 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAAA ('A' == active, '.' == missing)
/dev/sde4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 75dbad04:d4fb7f9b:0491f141:b74b4c9a
Update Time : Fri May 9 20:30:51 2014
Checksum : 59087010 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdf4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdf4
/dev/sdf4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 43886add:b1f43e44:ace2b383:a286f556
Update Time : Fri May 9 20:30:51 2014
Checksum : d8efa250 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdf4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 43886add:b1f43e44:ace2b383:a286f556
Update Time : Fri May 9 20:30:51 2014
Checksum : d8efa250 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdg4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdg4
/dev/sdg4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 8bc291f2:34f4c2f2:02b38869:a1adb7b3
Update Time : Fri May 9 20:30:51 2014
Checksum : df31d372 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 3
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdg4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 6c9bb462:66bd6902:e31c37ae:900aac77
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:22:27 2014
Raid Level : raid6
Raid Devices : 4
Avail Dev Size : 204672 (99.95 MiB 104.79 MB)
Array Size : 204544 (199.78 MiB 209.45 MB)
Used Dev Size : 204544 (99.89 MiB 104.73 MB)
Data Offset : 128 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 8bc291f2:34f4c2f2:02b38869:a1adb7b3
Update Time : Fri May 9 20:30:51 2014
Checksum : df31d372 - correct
Events : 270
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 3
Array State : AAAA ('A' == active, '.' == missing)
物理ボリュームの追加をまとめて行う
上記では、事前に物理ボリュームの追加(スペアディスクの追加)を行っています。「5.」の手順で物理ボリュームの追加をまとめて行うことができます。
1~2.論理ボリュームの確認/物理ボリュームの確認
上記の手順と同じです。3.RAIDレベルを変更する
以下のコマンドを実行し、「RAID 6」アレイに変更します。コマンドやオプションの説明は「アレイのRAIDレベルを変更するコマンドの説明」を参考にしてください。
赤字の箇所が追加したオプションです。
sudo mdadm --grow /dev/md/RAID5Array --level=raid6 --backup-file=/root/RAID5ArrayBackup.reshape --raid-devices=4 --add /dev/sdg4
4.コマンドの実行結果
以下のようにコマンドの実行結果が表示されます。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --grow /dev/md/RAID5Array --level=raid6 --backup-file=/root/RAID5ArrayBackup.reshape --raid-devices=4 --add /dev/sdg4
mdadm: level of /dev/md/RAID5Array changed to raid6
mdadm: added /dev/sdg4
mdadm: level of /dev/md/RAID5Array changed to raid6
mdadm: added /dev/sdg4