CentOS 7修改默认内核

查看当前系统内有几个内核

[root@k8s-node01 ~]# cat /boot/efi/EFI/centos/grub.cfg | grep menuentry
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1127.el7.x86_64-advanced-4fdb4656-7d02-4871-a450-7aa5d84d8320' {
menuentry 'CentOS Linux (3.10.0-1160.66.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1127.el7.x86_64-advanced-4fdb4656-7d02-4871-a450-7aa5d84d8320' {
menuentry 'CentOS Linux (3.10.0-1160.62.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1127.el7.x86_64-advanced-4fdb4656-7d02-4871-a450-7aa5d84d8320' {
menuentry 'CentOS Linux (3.10.0-1127.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1127.el7.x86_64-advanced-4fdb4656-7d02-4871-a450-7aa5d84d8320' {
menuentry 'CentOS Linux (0-rescue-51879195ffdb4352b423803011f88896) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-51879195ffdb4352b423803011f88896-advanced-4fdb4656-7d02-4871-a450-7aa5d84d8320' {

查看系统当前默认内核

[root@k8s-node01 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1160.66.1.el7.x86_64) 7 (Core)

修改当前系统默认内核

[root@k8s-node01 ~]# grub2-set-default 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)'

重启系统并查看内核

[root@k8s-node01 ~]#[root@k8s-node01 ~]# reboot
[root@k8s-node01 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)

你可能感兴趣的:(CentOS 7修改默认内核)