RAID 6アレイをRAID 5アレイに変更するコマンドの例
「RAID 6」アレイを「RAID 5」アレイに変更するコマンドの例です。この操作は「アレイの再形成」に該当します。
環境について
「RAID 6」アレイの作成については、以下を参考にしてください。ポイント
このRAIDレベルの変更におけるポイントです。「RAID 5」アレイは、1種類のパリティーブロックで冗長性を提供するアレイです。
物理ボリューム数(スロット数)が1つ減り、最後の物理ボリュームが「スペアディスク」になります。
1.論理ボリュームの確認
比較のため現状の論理ボリュームの情報を確認します。「RAID 6」アレイであることが分かります。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --detail /dev/md/RAID6Array
/dev/md/RAID6Array:
Version : 1.2
Creation Time : Fri May 9 20:44:13 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:44:21 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:RAID6Array (local to host ubuntu-vb-1404)
UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Events : 17
Number Major Minor RaidDevice State
0 8 53 0 active sync /dev/sdd5
1 8 69 1 active sync /dev/sde5
2 8 85 2 active sync /dev/sdf5
3 8 101 3 active sync /dev/sdg5
/dev/md/RAID6Array:
Version : 1.2
Creation Time : Fri May 9 20:44:13 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:44:21 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:RAID6Array (local to host ubuntu-vb-1404)
UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Events : 17
Number Major Minor RaidDevice State
0 8 53 0 active sync /dev/sdd5
1 8 69 1 active sync /dev/sde5
2 8 85 2 active sync /dev/sdf5
3 8 101 3 active sync /dev/sdg5
2.物理ボリュームの確認
物理ボリュームの情報を確認します。「RAID 6」アレイであることが分かります。
/dev/sdd5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdd5
/dev/sdd5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 51ca4aa1:3a01807b:8ac2451b:c9411d73
Update Time : Fri May 9 20:44:21 2014
Checksum : d8447fc3 - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdd5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 51ca4aa1:3a01807b:8ac2451b:c9411d73
Update Time : Fri May 9 20:44:21 2014
Checksum : d8447fc3 - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAAA ('A' == active, '.' == missing)
/dev/sde5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sde5
/dev/sde5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : e9b91527:2c84a7bf:22b07ce4:9e0f5457
Update Time : Fri May 9 20:44:21 2014
Checksum : 4fa4adbc - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAAA ('A' == active, '.' == missing)
/dev/sde5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : e9b91527:2c84a7bf:22b07ce4:9e0f5457
Update Time : Fri May 9 20:44:21 2014
Checksum : 4fa4adbc - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdf5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdf5
/dev/sdf5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 94210b00:29e63500:50e7c41e:a1701142
Update Time : Fri May 9 20:44:21 2014
Checksum : 8e2e0f94 - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdf5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 94210b00:29e63500:50e7c41e:a1701142
Update Time : Fri May 9 20:44:21 2014
Checksum : 8e2e0f94 - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdg5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdg5
/dev/sdg5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 1a2dde4d:1c9b1c7f:4702a61d:3334ef1c
Update Time : Fri May 9 20:44:21 2014
Checksum : 34a6ae98 - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 3
Array State : AAAA ('A' == active, '.' == missing)
/dev/sdg5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 1a2dde4d:1c9b1c7f:4702a61d:3334ef1c
Update Time : Fri May 9 20:44:21 2014
Checksum : 34a6ae98 - correct
Events : 17
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 3
Array State : AAAA ('A' == active, '.' == missing)
3.RAIDレベルを変更する
以下のコマンドを実行し、「RAID 5」アレイに変更します。コマンドやオプションの説明は「アレイのRAIDレベルを変更するコマンドの説明」を参考にしてください。
sudo mdadm --grow /dev/md/RAID6Array --level=raid5 --backup-file=/root/RAID6ArrayBackup.reshape
4.コマンドの実行結果
コマンドの実行結果は特に表示されません。
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --grow /dev/md/RAID6Array --level=raid5 --backup-file=/root/RAID6ArrayBackup.reshape
ubuntu@ubuntu-vb-1404:~$
ubuntu@ubuntu-vb-1404:~$
5.論理ボリュームの確認
論理ボリュームの情報を確認します。以下のことが分かります。
- RAID 5アレイである
- 物理ボリューム数(アレイのスロット数)が1つ減り、3つになっている
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --detail /dev/md/RAID6Array
/dev/md/RAID6Array:
Version : 1.2
Creation Time : Fri May 9 20:44:13 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 21:14:42 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:RAID6Array (local to host ubuntu-vb-1404)
UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Events : 258
Number Major Minor RaidDevice State
0 8 53 0 active sync /dev/sdd5
1 8 69 1 active sync /dev/sde5
2 8 85 2 active sync /dev/sdf5
3 8 101 - spare /dev/sdg5
/dev/md/RAID6Array:
Version : 1.2
Creation Time : Fri May 9 20:44:13 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 21:14:42 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:RAID6Array (local to host ubuntu-vb-1404)
UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Events : 258
Number Major Minor RaidDevice State
0 8 53 0 active sync /dev/sdd5
1 8 69 1 active sync /dev/sde5
2 8 85 2 active sync /dev/sdf5
3 8 101 - spare /dev/sdg5
6.物理ボリュームの確認
物理ボリュームの情報を確認します。「RAID 5」アレイであることが分かります。
/dev/sdd5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdd5
/dev/sdd5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 51ca4aa1:3a01807b:8ac2451b:c9411d73
Update Time : Fri May 9 21:14:42 2014
Checksum : d846c6e8 - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAA ('A' == active, '.' == missing)
/dev/sdd5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 51ca4aa1:3a01807b:8ac2451b:c9411d73
Update Time : Fri May 9 21:14:42 2014
Checksum : d846c6e8 - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 0
Array State : AAA ('A' == active, '.' == missing)
/dev/sde5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sde5
/dev/sde5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : e9b91527:2c84a7bf:22b07ce4:9e0f5457
Update Time : Fri May 9 21:14:42 2014
Checksum : 4fa6f4e1 - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAA ('A' == active, '.' == missing)
/dev/sde5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : e9b91527:2c84a7bf:22b07ce4:9e0f5457
Update Time : Fri May 9 21:14:42 2014
Checksum : 4fa6f4e1 - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 1
Array State : AAA ('A' == active, '.' == missing)
/dev/sdf5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdf5
/dev/sdf5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 94210b00:29e63500:50e7c41e:a1701142
Update Time : Fri May 9 21:14:42 2014
Checksum : 8e3056b9 - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAA ('A' == active, '.' == missing)
/dev/sdf5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 94210b00:29e63500:50e7c41e:a1701142
Update Time : Fri May 9 21:14:42 2014
Checksum : 8e3056b9 - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : Active device 2
Array State : AAA ('A' == active, '.' == missing)
/dev/sdg5
ubuntu@ubuntu-vb-1404:~$ sudo mdadm --examine /dev/sdg5
/dev/sdg5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 1a2dde4d:1c9b1c7f:4702a61d:3334ef1c
Update Time : Fri May 9 21:14:42 2014
Checksum : 34a8f5bd - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : spare
Array State : AAA ('A' == active, '.' == missing)
/dev/sdg5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : d12dc9d8:f6425c05:3ae45d13:e056fde8
Name : ubuntu-vb-1404:RAID6Array (local to host ubuntu-vb-1404)
Creation Time : Fri May 9 20:44:13 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 : 1a2dde4d:1c9b1c7f:4702a61d:3334ef1c
Update Time : Fri May 9 21:14:42 2014
Checksum : 34a8f5bd - correct
Events : 258
Layout : left-symmetric
Chunk Size : 128K
Device Role : spare
Array State : AAA ('A' == active, '.' == missing)