centos启动加载内核模块的方法

以内核模块 drbd 为例:

1、创建 /etc/modules-load.d/drbd.conf 中,直接写模块名:  drbd

2、创建 /etc/sysconfig/modules/drbd.modules:内容如下

# drbd module exists?
/usr/sbin/modinfo -F filename drbd &>/dev/null
if [ "$?" -eq 0 ];then 
    /usr/sbin/modprobe drbd
fi
posted @ 2021-03-26 18:06  lincappu  阅读(839)  评论(0编辑  收藏  举报