1.添加虚拟硬盘
如下图所示添加4块成员硬盘(RAID6的最小成员硬盘数量为4)
2.安装mdadm
sudo yum install mdadm
3.创建RAID
查看mdadm的使用方法
Joe@openeuler ~]$ sudo mdadm --create --help
Usage: mdadm --create device --chunk=X --level=Y --raid-devices=Z devicesThis usage will initialise a new md array, associate somedevices with it, and activate the array. In order to create anarray with some devices missing, use the special word 'missing' inplace of the relevant device name.Before devices are added, they are checked to see if they already containraid superblocks or filesystems. They are also checked to see ifthe variance in device size exceeds 1%.If any discrepancy is found, the user will be prompted for confirmationbefore the array is created. The presence of a '--run' can override thiscaution.If the --size option is given then only that many kilobytes of eachdevice is used, no matter how big each device is.If no --size is given, the apparent size of the smallest drive givenis used for raid level 1 and greater, and the full device is used forother levels.Options that are valid with --create (-C) are:--bitmap= -b : Create a bitmap for the array with the given filename: or an internal bitmap if 'internal' is given--chunk= -c : chunk size in kibibytes--rounding= : rounding factor for linear array (==chunk size)--level= -l : raid level: 0,1,4,5,6,10,linear,multipath and synonyms--parity= -p : raid5/6 parity algorithm: {left,right}-{,a}symmetric--layout= : same as --parity, for RAID10: [fno]NN --raid-devices= -n : number of active devices in array--spare-devices= -x : number of spare (eXtra) devices in initial array--size= -z : Size (in K) of each drive in RAID1/4/5/6/10 - optional--data-offset= : Space to leave between start of device and start: of array data.--force -f : Honour devices as listed on command line. Don't: insert a missing drive for RAID5.--run -R : insist of running the array even if not all: devices are present or some look odd.--readonly -o : start the array readonly - not supported yet.--name= -N : Textual name for array - max 32 characters--bitmap-chunk= : bitmap chunksize in Kilobytes.--delay= -d : bitmap update delay in seconds.--write-journal= : Specify journal device for RAID-4/5/6 array--consistency-policy= : Specify the policy that determines how the array-k : maintains consistency in case of unexpected shutdown.
我们使用到上面的 --chunk --level --raid-devices参数
sudo mdadm --create /dev/md0 --chunk=1M --level=6 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
至此完成阵列创建