RAID 5アレイをRAID 4アレイに変更するコマンドの例
「RAID 5」アレイを「RAID 4」アレイに変更するコマンドの例です。この操作は「アレイの再形成」に該当します。
環境について
「RAID 5」アレイの作成については、以下を参考にしてください。ポイント
このRAIDレベルの変更におけるポイントです。「RAID 4」アレイは、「RAID 5」アレイの「データレイアウト」を「parity-last」にしたものです。
1.論理ボリュームの確認
比較のため現状の論理ボリュームの情報を確認します。「RAID 5」アレイであることが分かります。
また「データレイアウト」は「Left Symmetric」であることが分かります。
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」アレイであることが分かります。
また「データレイアウト」は「Left Symmetric」であることが分かります。
/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.RAIDレベルを変更する
以下のコマンドを実行し、「RAID 0」アレイに変更します。コマンドやオプションの説明は「アレイのRAIDレベルを変更するコマンドの説明」を参考にしてください。
sudo mdadm --grow /dev/md/RAID5Array --level=raid4 --backup-file=/root/RAID5ArrayBackup.reshape
4.コマンドの実行結果
コマンドの実行結果は特に表示されません。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --grow /dev/md/RAID5Array --level=raid4 --backup-file=/root/RAID5ArrayBackup.reshape
ubuntu@ubuntu-vb-1404:~$
ubuntu@ubuntu-vb-1404:~$
5.論理ボリュームの確認
論理ボリュームの情報を確認します。以下のことが分かります。
- RAID 4アレイである
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --detail /dev/md/RAID5Array
/dev/md/RAID5Array:
Version : 1.2
Creation Time : Fri May 9 19:52:31 2014
Raid Level : raid4
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 20:01:09 2014
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Events : 267
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 19:52:31 2014
Raid Level : raid4
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 20:01:09 2014
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Chunk Size : 128K
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
UUID : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Events : 267
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
6.物理ボリュームの確認
物理ボリュームの情報を確認します。「RAID 4」アレイであることが分かります。
/dev/sdd4
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdd4
/dev/sdd4:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 19:52:31 2014
Raid Level : raid4
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 : df78dfcb:a3a51b99:497c64a3:a44b8f1d
Update Time : Fri May 9 20:01:09 2014
Checksum : 8149f41e - correct
Events : 267
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 : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 19:52:31 2014
Raid Level : raid4
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 : df78dfcb:a3a51b99:497c64a3:a44b8f1d
Update Time : Fri May 9 20:01:09 2014
Checksum : 8149f41e - correct
Events : 267
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 : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 19:52:31 2014
Raid Level : raid4
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 : 22ce417f:856d5a79:5b0f9673:ab7d0c6b
Update Time : Fri May 9 20:01:09 2014
Checksum : 3299d65d - correct
Events : 267
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 : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 19:52:31 2014
Raid Level : raid4
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 : 22ce417f:856d5a79:5b0f9673:ab7d0c6b
Update Time : Fri May 9 20:01:09 2014
Checksum : 3299d65d - correct
Events : 267
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 : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 19:52:31 2014
Raid Level : raid4
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 : d1b892a8:c27b7549:c564b733:a5fad82d
Update Time : Fri May 9 20:01:09 2014
Checksum : aef3a1ae - correct
Events : 267
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 : 0935444a:a835aaa6:2d9328ea:0fe2a72e
Name : ubuntu-vb-1404:RAID5Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 19:52:31 2014
Raid Level : raid4
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 : d1b892a8:c27b7549:c564b733:a5fad82d
Update Time : Fri May 9 20:01:09 2014
Checksum : aef3a1ae - correct
Events : 267
Chunk Size : 128K
Device Role : Active device 2
Array State : AAA ('A' == active, '.' == missing)