# yum install mdadm
Vytvoření RAIDů, Linuxová klasika via mdadm, například:
# mdadm --create /dev/md4 --level=1 --raid-devices=2 /dev/sde /dev/sdao # mdadm --create /dev/md3 --level raid10 --raid-disks 6 /dev/sda /dev/sdc /dev/sdd missing /dev/sdg missing
Ověření existence RAIDů:
# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] [raid10] [raid0] [raid1] md4 : active raid1 sdao[1] sde[0] 195229888 blocks super 1.2 [2/2] [UU] bitmap: 0/2 pages [0KB], 65536KB chunk md3 : active raid10 sdc[0] sdb[5] sdf[4] sdar[3] sdd[2] sdap[1] 1757790720 blocks super 1.2 512K chunks 2 near-copies [6/6] [UUUUUU] md0 : active raid0 md1[0] md2[1] 23439362048 blocks super 1.2 5120k chunks md1 : active raid6 dm-23[11] dm-25[10] dm-19[8] dm-22[3] dm-21[2] dm-20[9] dm-16[6] dm-18[7] dm-17[1] dm-15[0] dm-13[5] dm-10[4] 11719818240 blocks super 1.2 level 6, 512k chunk, algorithm 2 [12/12] [UUUUUUUUUUUU] bitmap: 0/9 pages [0KB], 65536KB chunk md2 : active raid6 dm-26[1] dm-24[0] dm-14[2] dm-12[11] dm-11[9] dm-9[5] dm-8[8] dm-7[7] dm-6[10] dm-4[6] dm-5[4] dm-3[3] 11719818240 blocks super 1.2 level 6, 512k chunk, algorithm 2 [12/12] [UUUUUUUUUUUU] bitmap: 0/9 pages [0KB], 65536KB chunk unused devices: <none>
U stavby RAID-60 je vhodné položit RAID0.chunk-size = (#disků-2 * RAID6.chunk_size). Viz md0 a md1+md2 výše.
Autostart RAIDů vyžaduje /etc/mdadm.conf, například:
# cat /etc/mdadm.conf DEVICE /dev/mapper/mpath* /dev/md1 /dev/md2 /dev/disk/by-path/pci-0000:83:* /dev/disk/by-path/pci-0000:84:* ARRAY /dev/md1 metadata=1.2 name=disk1:1 UUID=b7d2a036:7965786a:85554624:1d3b516f ARRAY /dev/md2 metadata=1.2 name=disk1:2 UUID=473515a3:c94bd22f:ca90fb36:7c2d87cb ARRAY /dev/md0 metadata=1.2 name=disk1:0 UUID=7c1f394d:04438a59:6d2f34e2:560dd3fc ARRAY /dev/md3 metadata=1.2 name=disk1:3 UUID=b864bf4a:637f7454:5b670270:a9ee8af7 ARRAY /dev/md4 metadata=1.2 name=localhost.localdomain:4 UUID=193a433b:766ac810:d86a76d7:fdfd41a0
Tvorba:
# mdadm --detail --scan >/etc/mdadm.conf
…ale i tak je nutné doplnit příslušný DEVICE řádek konfigurace.
-- LeoGalambos - 21 Aug 2016