Ubuntu 16.04では、mdadmを使用してRAID50を作成できません。サーバーを再起動するたびにRAID0が消えます。
RAID50を作成する方法は次のとおりです。
2つのRAID5(それぞれ8つのディスク)を作成します。
#Create RAID5 (md1)
mdadm --create /dev/md1 -v --raid-devices=8 --level=5 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1 /dev/nvme6n1 /dev/nvme7n1
#Create RAID5 (md2)
mdadm --create /dev/md2 -v --raid-devices=8 --level=5 /dev/nvme8n1 /dev/nvme9n1 /dev/nvme10n1 /dev/nvme11n1 /dev/nvme12n1 /dev/nvme13n1 /dev/nvme14n1 /dev/nvme15n1
RAID0を作成する前にディスクが再構築されるのを待ちます。
これまでは、すべてが期待どおりに機能しています。
$ cat /proc/mdstat
md2 : active raid5 nvme10n1[5] nvme15n1[3] nvme12n1[6] nvme8n1[2] nvme11n1[1] nvme14n1[8] nvme5n1[0] nvme2n1[4]
21878398976 blocks super 1.2 level 5, 512k chunk, algorithm 2 [8/8] [UUUUUUUU]
bitmap: 0/24 pages [0KB], 65536KB chunk
md1 : active raid5 nvme13n1[8] nvme9n1[6] nvme7n1[2] nvme6n1[3] nvme4n1[4] nvme3n1[5] nvme1n1[1] nvme0n1[0]
21878398976 blocks super 1.2 level 5, 512k chunk, algorithm 2 [8/8] [UUUUUUUU]
bitmap: 0/24 pages [0KB], 65536KB chunk
md126 : active raid1 sda[1] sdb[0]
890796032 blocks super external:/md127/0 [2/2] [UU]
md127 : inactive sdb[1](S) sda[0](S)
6306 blocks super external:imsm
unused devices: <none>
RAID5が完全に再構築されたら、RAID0の作成を開始します。
#Create RAID0 (md0)
sudo mdadm --create /dev/md0 -v --raid-devices=2 --level=0 /dev/md1 /dev/md2
確認してみると、まだ大丈夫に見えます。
$ cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active raid0 md2[1] md1[0]
43756535808 blocks super 1.2 512k chunks
md2 : active raid5 nvme10n1[5] nvme15n1[3] nvme12n1[6] nvme8n1[2] nvme11n1[1] nvme14n1[8] nvme5n1[0] nvme2n1[4]
21878398976 blocks super 1.2 level 5, 512k chunk, algorithm 2 [8/8] [UUUUUUUU]
bitmap: 1/24 pages [4KB], 65536KB chunk
md1 : active raid5 nvme13n1[8] nvme9n1[6] nvme7n1[2] nvme6n1[3] nvme4n1[4] nvme3n1[5] nvme1n1[1] nvme0n1[0]
21878398976 blocks super 1.2 level 5, 512k chunk, algorithm 2 [8/8] [UUUUUUUU]
bitmap: 1/24 pages [4KB], 65536KB chunk
md126 : active raid1 sda[1] sdb[0]
890796032 blocks super external:/md127/0 [2/2] [UU]
md127 : inactive sdb[1](S) sda[0](S)
6306 blocks super external:imsm
unused devices: <none>
再起動するとRAID0(md0)が消えました。
md2 : active raid5 nvme10n1[5] nvme15n1[3] nvme12n1[6] nvme8n1[2] nvme11n1[1] nvme14n1[8] nvme5n1[0] nvme2n1[4]
21878398976 blocks super 1.2 level 5, 512k chunk, algorithm 2 [8/8] [UUUUUUUU]
bitmap: 0/24 pages [0KB], 65536KB chunk
md1 : active raid5 nvme13n1[8] nvme9n1[6] nvme7n1[2] nvme6n1[3] nvme4n1[4] nvme3n1[5] nvme1n1[1] nvme0n1[0]
21878398976 blocks super 1.2 level 5, 512k chunk, algorithm 2 [8/8] [UUUUUUUU]
bitmap: 0/24 pages [0KB], 65536KB chunk
md126 : active raid1 sda[1] sdb[0]
890796032 blocks super external:/md127/0 [2/2] [UU]
md127 : inactive sdb[1](S) sda[0](S)
6306 blocks super external:imsm
私が間違っていることを知っていますか?