Two Problems in upgrading CentOS 6 Kernel to Kernel 3.x

Source: Internet
Author: User

Two Problems in upgrading CentOS 6 Kernel to Kernel 3.x

Problem:

Before the production of openstack CentOS6.5 template image, the kernel is 2.6.xx, now need to make a kernel for 3. x centos6 image, use rpm package kernel-ml-3.18.3-1.el6.elrepo.x86_64.rpm to upgrade the kernel, restart the virtual machine error:

FATAL: Module scsi_wait_scan not found.

If you perform further tests, you will find that upgrading the kernel on the physical machine is okay!

Note: The following operations are performed on the kvm virtual machine. This problem does not exist when the physical machine upgrades the kernel.

Analysis:

1. This error occurs because the Virtual Machine in KVM uses the virtio semi-virtualization driver to support scsi devices. However, the virtio driver is not used when the physical machine is upgraded.

2. In centos6, The Dracut program is used to generate the system's initramfs. img. During kernel installation, Dracut identifies the kernel module virtio_blk.ko through"

"The functions provided in the file are identified as follows:

Before kernel3.13, Dracut installed the virtio_blk.ko module through the "blk_init_queue" function. After kernel3.13, the new function "blk_mq_init_queue" is required to install the virtio_blk.ko module ", however, the Dracut program in centos6 still uses the old function "blk_init_queue". Therefore, virtio_blk.ko cannot be installed. The key to solving the problem is to ensure that virtio_blk.ko can be installed.

Solution 1:

Edit file/usr/share/dracut/modules. d/90kernel-modules/installkernel

Vim/usr/share/dracut/modules. d/90kernel-modules/installkernel
# Replace "blk_init_queue" with "blk_mq_init_queue"

Run the rpm-ivh command to install the kernel package.

Note: Another solution:

This solution can also be enabled successfully, but cannot be hot-plugged into the hard disk. For example, if you use virsh attach/detach to dynamically load the hard disk for a virtual machine on the host machine, you must restart the virtual machine to take effect, the first solution is to perform hotplug, that is, hot plugging, and

1. download and install the new kernel version rpm package (3.18)

Here is

Rpm-ivh kernel-ml-3.18.3-1.el6.elrepo.x86_64.rpm

2. Solve virtio driver problems

# Add virtio_blk support (create a conf file)
Echo 'add _ drivers + = "virtio_blk" '>/etc/dracut. conf. d/force-vitio_blk-to-ensure-boot.conf
# Backing up initramfs
Cp/boot/initramfs-3.18.3-1.el6.elrepo.x86_64.img/boot/initramfs-3.18.3-1.el6.elrepo.x86_64.img.bak
# Re-compile and generate initramfs
Dracut-f/boot/initramfs-3.18.3-1.el6.elrepo.x86_64.img 3.18.3-1. el6.elrepo. x86_64

3. Modify grub. conf

Default = 0 # default is the new kernel
Timeout = 5
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Hiddenmenu
Title Red Hat Enterprise Linux Server (3.18.3-1. el6.elrepo. x86_64)
Root (hd0, 0)
Kernel/vmlinuz-3.18.3-1.el6.elrepo.x86_64...

The Ubuntu 13.10 (Saucy Salamander) Kernel has been upgraded to Linux Kernel 3.10 RC5

Linux Kernel 3.4.62 LTS is now available for download

How to install Linux kernel 13.10 On Ubuntu 3.12

How to install the 3.16.7 CKT2 kernel in Ubuntu 14.10, Ubuntu 14.04, and its derivative versions

Linux Kernel: click here
Linux Kernel: click here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.