[LINUX] VM cannot boot with specific kernel of CentOS7

The virtual infrastructure is Xen Server

Event

If you stop / start the VM, it will stop during the running process. In case of restart (shutdown -r now), it will start. Is there a cause during kernel-related processing?

Verification

When I switched the kernel used at startup and stopped / started the server, As of March 19, 2018, it stops during booting only for the latest kernel.

NG kernel (latest): kernel-3.10.0-693.21.1.el7.x86_64 OK kernel (one before the latest): kernel-3.10.0-693.17.1.el7.x86_64

Thing you want to do

After installing the OK kernel, delete the NG kernel. Overwrite the kernel related packages with the old version.

What i did

Check kernel version

# rpm -qa | grep kernel
# uname -a

Check the kernel to be deleted and the rescue file corresponding to the kernel to be deleted (Check the file name under / boot)

# sha1sum /boot/vmlinuz-0-rescue-08564da404bc43dabf31941d25b25cb1 /boot/vmlinuz-3.10.0-693.21.1.el7.x86_64
ce98558979b4397fa8b7b59bcbd69ecd4cf38c19  /boot/vmlinuz-0-rescue-08564da404bc43dabf31941d25b25cb1
ce98558979b4397fa8b7b59bcbd69ecd4cf38c19  /boot/vmlinuz-3.10.0-693.21.1.el7.x86_64

→ Since the hash value is the same, delete this rescue file later

Install OK kernel

# rpm -ivh --force http://mirror.centos.org/centos/7/updates/x86_64/Packages/kernel-3.10.0-693.17.1.el7.x86_64.rpm

Install kernel related packages (remove → install)

# rpm --oldpackage -Uvh http://mirror.centos.org/centos/7/updates/x86_64/Packages/kernel-headers-3.10.0-693.17.1.el7.x86_64.rpm
# rpm --oldpackage -Uvh http://mirror.centos.org/centos/7/updates/x86_64/Packages/kernel-tools-3.10.0-693.17.1.el7.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/kernel-tools-libs-3.10.0-693.17.1.el7.x86_64.rpm

※kernel-tools-libs and kernel-Trying to install tools separately
Then, I got a dependency error, so it's no good.
 --------------------------------------------------------------
error:Lack of dependency:
        kernel-tools-libs = 3.10.0-693.17.1.el7 is kernel-tools-3.10.0-693.17.1.el7.x86_Required for 64
 --------------------------------------------------------------

Erase the NG kernel

# rpm -e kernel-3.10.0-693.21.1.el7.x86_64

Verification

# rpm -qa | grep kernel

Delete rescue file for NG kernel (Judgment by time stamp / If you don't know, you may leave it alone) ・ Vmlinuz-0-rescue-xxx → Confirmed at the beginning ・ Initramfs-0-rescue-xxx → The same time stamp as the above file

# cd /boot
# rm vmlinuz-0-rescue-f444db9ee4694d4da94a6801fda39bff initramfs-0-rescue-f444db9ee4694d4da94a6801fda39bff.img

Recreate grub config file

# grub2-mkconfig -o /boot/grub2/grub.cfg

Try stopping / starting the server

# shutdown -h now (→ then start)
# rpm -qa | grep kernel
kernel-3.10.0-229.11.1.el7.x86_64
kernel-headers-3.10.0-693.17.1.el7.x86_64
kernel-3.10.0-693.17.1.el7.x86_64
kernel-tools-libs-3.10.0-693.17.1.el7.x86_64
kernel-3.10.0-229.4.2.el7.x86_64
kernel-3.10.0-327.18.2.el7.x86_64
kernel-3.10.0-514.6.1.el7.x86_64
kernel-tools-3.10.0-693.17.1.el7.x86_64

Recommended Posts

VM cannot boot with specific kernel of CentOS7
Dual boot of Windows10, CentOS
Boot CentOS 8 from Windows 10 with Wake On LAN
Installation of CentOS 8
Play with CentOS 8
Performs high-speed calculation of only specific descriptors with mordred