CentOS7修改默认启动内核

Posted YJ.li

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7修改默认启动内核相关的知识,希望对你有一定的参考价值。

查看可用内核

# grep "menuentry" /boot/grub2/grub.cfg 
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
menuentry \'CentOS Linux (5.4.123-1.el7.elrepo.x86_64) 7 (Core)\' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option \'gnulinux-5.4.123-1.el7.elrepo.x86_64-advanced-21730aff-e265-4713-9973-d43721b73cb4\' {
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-1160.el7.x86_64-advanced-21730aff-e265-4713-9973-d43721b73cb4\' {
menuentry \'CentOS Linux (0-rescue-577567423019484e9466d9570b6fbb17) 7 (Core)\' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option \'gnulinux-0-rescue-577567423019484e9466d9570b6fbb17-advanced-21730aff-e265-4713-9973-d43721b73cb4\' {

查看当前内核

# uname -r
5.4.123-1.el7.elrepo.x86_64

修改开机时默认使用的内核

# grub2-set-default \'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)\'

查看内核修改结果

# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)

以上是关于CentOS7修改默认启动内核的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7修改默认启动内核

centos7设置默认的内核启动

Linux - 修改内核启动顺序及删除无用内核

Linux - 修改内核启动顺序及删除无用内核

centos7 选定默认启动内核,及删除无用内核

云服务器 ECS Linux CentOS 修改内核引导顺序