Home >Operation and Maintenance >CentOS >What should I do if the centos system cannot start after upgrading the kernel?

What should I do if the centos system cannot start after upgrading the kernel?

王林
王林Original
2020-03-21 14:17:586271browse

What should I do if the centos system cannot start after upgrading the kernel?

The solution process is as follows:

Query the 3.10.0 initramfs driver

[root@localhost ~]# lsinitrd -k 3.10.0-957.el7.x86_64 | grep mpt[23]sas
drwxr-xr-x 2 root root 0 Nov 12 19:24 usr/lib/modules/3.10.0-957.el7.x86_64/kernel/drivers/scsi/mpt3sas
-rw-r--r-- 1 root root 92972 Nov 9 2018 usr/lib/modules/3.10.0-957.el7.x86_64/kernel/drivers/scsi/mpt3sas/mpt2sas.ko.xz

You can see that it is the mpt2sas driver in the 3.10 kernel, but in In the 5.x kernel, I saw that the new version of the kernel has upgraded mpt2sas to mpt3sas

[root@localhost ~]# ls /usr/lib/modules/5.3.6-1.el7.elrepo.x86_64/kernel/drivers/scsi/mpt3sas/mpt3sas.ko
/usr/lib/modules/5.3.6-1.el7.elrepo.x86_64/kernel/drivers/scsi/mpt3sas/mpt3sas.ko

(Recommended tutorial: centos usage tutorial)

Query the 5.3.6 initramfs driver , you can see that there is no output, indicating that initramfs has not entered this driver.

[root@localhost ~]# lsinitrd -k 5.3.6-1.el7.elrepo.x86_64 | grep mpt[23]sas

The solution is as follows:

Method 1:

1. Modify the /etc/dracut.conf file and add fields

sed -i '/#add_drivers+=""/aadd_drivers+="mpt3sas"' /etc/dracut.conf

2 , Regenerate initramfs

cd /boot/
mv initramfs-5.3.6-1.el7.elrepo.x86_64.img{,.bak}
dracut -f /boot/initramfs-5.3.6-1.el7.elrepo.x86_64.img 5.3.6-1.el7.elrepo.x86_64

Method 2:

Force loading of the driver

dracut --force --add-drivers mpt3sas --kver=5.3.6

Choose one of the above methods to integrate the driver, and then do the following Check:

lsinitrd -k 5.3.6-1.el7.elrepo.x86_64 | grep mpt[23]sas

If there is output, it is normal, then restart the operating system.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of What should I do if the centos system cannot start after upgrading the kernel?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn