安装lio_target需要特殊组件,先配置kernel,再安装lio_target
#配置kernel
rpm -ivh kernel-3.10.0-862.2.3.el7.src.rpm(忽略此次报错)
cd /root/rpmbuild/SPECS/
rpmbuild -bp kernel.spec --nodeps
cd ../BUILD/kernel-3.10.0-862.2.3.el7/linux-3.10.0-862.2.3.el7.x86_64/
make prepare
cp -r ../linux-3.10.0-862.2.3.el7.x86_64 /usr/src
#安装lio_target
cd ChelsioUwire-3.9.0.0
make lio_install KSRC="/usr/src/linux-3.10.0-862.2.3.el7.x86_64/" KOBJ="/lib/modules/3.10.0-862.el7.x86_64/build/"
#卸载inbox模块
rmmod csiostor cxgb4i cxgbit iw_cxgb4 chcr cxgb4vf cxgb4 libcxgbi libcxgb
#加载模块
modprobe cxgb4
modprobe cxgbit
#开启lio iscsi target的offload功能
echo 1 > /sys/kernel/config/target/iscsi/iqn.2003-01.org.target/tpgt_1/np/182.168.2.49:3260/cxgbit
#卸载iscsi
rmmod cxgb4i
rmmod libcxgbi
kernel 4.19.4-1.el7.elrepo.x86_64 T420-CR安装lio