此教程仅适用于debian11/12系统,其他系统根据需求做调整
apt update
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/hwraid-archive-keyring.gpg --keyserver keyserver.ubuntu.com --recv-keys 6005210E23B3D3B4
#这里利用debian11的源,因为debian12源有问题
echo "deb [signed-by=/usr/share/keyrings/hwraid-archive-keyring.gpg] http://hwraid.le-vert.net/debian bullseye main" | sudo tee /etc/apt/sources.list.d/hwraid.list
wget -O hwraid.gpg https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/hwraid-archive-keyring.gpg --import hwraid.gpg
apt update
sudo apt install megacli megaclisas-status -y
#查看
megaclisas-status
#添加阵列(根据实际情况)a0代表阵列卡控制器
megacli -CfgLdAdd -r0 [32:3] -a0
#添加raid10阵列
megacli -CfgSpanAdd -r10 -Array0[20:1,20:2] -Array1[20:3,20:4] -a0
#如果是6块硬盘
megacli -CfgSpanAdd -r10 -Array0[20:1,20:2] -Array1[20:3,20:4] -Array2[20:5,20:6] -a0
#然后就可以 lsblk查看硬盘是否存在,然后挂载
#开启缓存
sudo megacli -LDInfo -Lall -aALL
megacli -LDSetProp EnDskCache -Lall -aAll