centos upgrade modify the kernel after kernel boot sequence

Guaren recent Red Hat systems bug fix, some need to upgrade the kernel to solve (specifically what information you need to upgrade the kernel to solve the bug, or Tell me what network), the original version of the system and kernel version

[root@t0 ~]# cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
[root@t0 ~]# uname -r
3.10.0-327.el7.x86_64

Upgrade to 3.10.0-957.27.2.el7.x86_64

Under normal circumstances, there are two startup items, a "normal start" and the other is the "rescue mode start" (rescue).
If more than two startup items, indicating that the current system has not removed the old kernel. The reason is not automatically delete old after CentOS kernel update.
To start the new kernel by default, you can select the temporary startup option, you can also modify the configuration permanently assigned.

First, check your system now has inside what version of the kernel

[root @ t0 ~] # uname - r # View the current kernel version
 3.10 . 0 - 957.27.2 .el7.x86_64 
[root @ t0 ~ ] # 
[root @ t0 ~] # CAT /boot/grub2/grub.cfg | grep  " menuentry " View all # kernel version 
menuentry ' CentOS Linux (3.10.0-327.el7.x86_64) 7 (core) ' --class the GNU-Linux CentOS --class --class the GNU --class os - $ menuentry_id_option Unrestricted ' gnulinux-3.10.0-327.el7.x86_64-advanced-e40bd680-Cabe-477A-acd0-00b97281f618 ' { 
menuentry 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-e40bd680-cabe-477a-acd0-00b97281f618' {
menuentry 'CentOS Linux (0-rescue-840af4f292644fe6b63eefc86c7f7b09) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-840af4f292644fe6b63eefc86c7f7b09-advanced-e40bd680-cabe-477a-acd0-00b97281f618' {
[root@t0 ~]# 
[root@t0 ~]# grub2-set-default 'The Linux the CentOS (3.10.0-327.el7.x86_64). 7 (Core) '# modified kernel version 3.10.0-327.el7.x86_64
[the root @ T0 ~ ] #

[T0 the root @
~] # grub2-editenv List # View kernel modifications result saved_entry= CentOS Linux (3.10.0-957.27.2.el7.x86_64)7(core)

 

Official advice is to keep at least two cores, so after a kernel upgrade, when the system is no problem, the new kernel can operate, do not show up, but if you insist, then delete the old kernel

 

[root@t0 ~]# yum remove kernel-3.10.0-327.el7.x86_64  # 删除指定的无用内核
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-327.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                           Arch                              Version                                      Repository                            Size
=============================================================================================================================================================
Removing:
 kernel                            x86_64                            3.10.0-327.el7                               @anaconda                            136 M

Transaction Summary
=============================================================================================================================================================
Remove  1 Package

Installed size: 136 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : kernel-3.10.0-327.el7.x86_64                                                                                                              1/1 
  Verifying  : kernel-3.10.0-327.el7.x86_64                                                                                                               1 / 1  

Removed The: 
  kernel.x86_64 0 : 3.10 . 0 - 327 .el7                                                                                                                              

Complete ! 
[root @ t0 ~ ] # 
[root @ t0 ~] # RPM -qa | grep kernel- [ 0 - 9 ] # see all kernel package 
kernel - 3.10 . 0 . -957.27 2 .el7.x86_64 
[root @ t0 ~]# 
[root@t0 ~]# cat /boot/grub2/grub.cfg |grep "menuentry "
menuentry 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-88ae7d3d-ffaf-4402-9d44-56b6845789e4' {
menuentry 'CentOS Linux (0-rescue-8405cda22c0b421db40478edcf9c1fb2) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-8405cda22c0b421db40478edcf9c1fb2-advanced-88ae7d3d-ffaf-4402-9d44-56b6845789e4' {
[root@CentOS-7 ~]# 

 

ps: GRUB_DEFAULT - set the default option. There are several situations.

= GRUB_DEFAULT 0 to position and set the preset menu options. The first menu option pen is 0 , the second pen is 1 , and so on. 
GRUB_DEFAULT = "CentOS *** " In this embodiment, the position of the menu will not be affected. 
For example: GRUB_DEFAULT = "the Ubuntu, the Linux 3.11 . 0 - 13 is - Generic." Note To complete the full name. 

GRUB_DEFAULT = power saved by the operating system stores default. And you can grub-reboot-SEt- GRUB default command to set a default operating system. The default operating system will not be set by selecting from an interactive menu. 
GRUB -set-default 0 to position and set the preset menu options. The first menu option pen is 0 , the second pen is 1 , and so on. 
GRUB -set- default "xxxx" is set to name 
GRUB -reboot 0The position to set the next reboot boot option. The first menu option pen is 0 , the second pen is 1 , and so on. 
GRUB -reboot "xxxx" in order to restart the boot menu name.

 

Guess you like

Origin www.cnblogs.com/augusite/p/11412245.html