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

WBOY
Release: 2022-04-14 14:34:28
Original
4833 people have browsed it

Method: 1. Add "add_drivers ="mpt3sas"" to the "/etc/dracut.conf" file and regenerate initramfs; 2. Use "dracut --force --add-drivers "Forcibly load the driver and then restart the system.

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

The operating environment of this article: centos 7 system, Dell G3 computer.

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

This problem exists after upgrading the kernel:

  • The system disk is on the onboard sata port The new kernel can be started normally and the panel hard disk can be recognized.

  • The system disk is inserted into the panel port. The new kernel cannot be started. The debugging found that the system disk cannot be found.

  • The system disk is plugged into the panel and the default 3.10 kernel can start normally.

The temporary solution is to plug the system into the onboard SATA port, because no specific solution was found at the time. After this problem lasted for a period of time, when I searched for information again recently, I located the problem in the driver within the initramfs and solved the problem

Solution process

Query the initramfs driver

[root@lab103 lab103]# lsinitrd -k 3.10.0-327.el7.x86_64|grep mpt[23]sas
drwxr-xr-x   2 root     root            0 Apr 17 12:05 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/scsi/mpt2sas
-rw-r--r--   1 root     root       337793 Nov 20  2015 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/scsi/mpt2sas/mpt2sas.ko
Copy after login

You can see that it is the mpt2sas driver in the 3.10 kernel

You can see the new version in the 4.x kernel

The kernel has upgraded mpt2sas to mpt3sas

/lib/modules/4.4.46/kernel/drivers/scsi/mpt3sas/mpt3sas.ko
Copy after login

Query the module in initramfs

lsinitrd -k  4.4.46|grep mpt[23]sas
Copy after login
Copy after login

You can see that there is no output, indicating that initramfs has not entered this driver

This place There are two ways to solve the problem

Method 1:

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

add_drivers+="mpt3sas"
Copy after login

Regenerate initramfs

dracut -f /boot/initramfs-4.4.46.img 4.4.46
Copy after login

Method 2:

Force loading of the driver

dracut --force --add-drivers mpt3sas --kver=4.4.46
Copy after login

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

lsinitrd -k  4.4.46|grep mpt[23]sas
Copy after login
Copy after login

If there is output, it is normal

Then restart the operating system

Recommended tutorial: "centos tutorial"

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!