全新安装的 CentOS 8 Stream (kernel 4.18.0-365.el8.x86_64) 开机启动报错:
[FAILED] Faild to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.
如图:
按提示运行systemctl status systemd-modules-load.service,发现是ipmi_si设备不存在导致。错误提示如下:
[ws@centos ~]$ systemctl status systemd-modules-load.service
● systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2022-03-06 10:10:36 EST; 8min ago
Docs: man:systemd-modules-load.service(8)
man:modules-load.d(5)
Process: 673 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
Main PID: 673 (code=exited, status=1/FAILURE)
Mar 06 10:10:36 centos systemd[1]: Starting Load Kernel Modules...
Mar 06 10:10:36 centos systemd-modules-load[673]: Module 'msr' is builtin
Mar 06 10:10:36 centos systemd-modules-load[673]: Failed to insert 'ipmi_si': No such device
Mar 06 10:10:36 centos systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
Mar 06 10:10:36 centos systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
Mar 06 10:10:36 centos systemd[1]: Failed to start Load Kernel Modules.
搜索发现centos 论坛中存在讨论帖(见文末),禁用ipmi_si kernel module可修复此问题。
故记录解决方法在此,供大家参考:
#查看启动失败服务
systemctl --failed
systemctl status systemd-modules-load.service
#配置blacklist
sudo tee /etc/modprobe.d/blacklist.conf << EOF
blacklist ipmi_si
install ipmi_si /bin/false
EOF
modprobe --showconfig | grep blacklist
#rebuild initial ramdisk image
sudo dracut -f
#set kernel command line parameters
sudo grub2-editenv - list | grep kernelopts
sudo grub2-editenv - set kernelopts="<output-last-step> ipmi_si.blacklist=1 rd.driver.blacklist=ipmi_si"
#例如
sudo grub2-editenv - set kernelopts="root=UUID=f3161552-2ff8-49b6-b5ec-6279aa515040 ro crashkernel=auto rhgb quiet ipmi_si.blacklist=1 rd.driver.blacklist=ipmi_si"
#Rebuild the kdump initial ramdisk image
sudo sed -i '/^KDUMP_COMMANDLINE_APPEND=/s/"$/ rd.driver.blacklist=ipmi_si"/' /etc/sysconfig/kdump
sudo kdumpctl restart
sudo mkdumprd -f /boot/initramfs-$(uname -r)kdump.img
sudo reboot
重启后,此问题消失。
参考:
https://forums.centos.org/viewtopic.php?t=78617
https://access.redhat.com/solutions/41278