快餐100微信-同城空降官方网站入口,附近约一泡50元,51品茶一品阁

关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

centos7.9多内核情况下手动指定启动内核

发布时间:2025/4/25 14:42:47
香港云服务器

查看GRUB缺省启动顺序

 cat /etc/default/grub | grep GRUB_DEFAULT  回显:GRUB_DEFAULT=saved

如果是saved,就是按照指定保存的内核启动,如果为数字(0/1/2等),就是/boot/grub2/grub.cfg中对应位置的内核,建议设置为saved。


查看当前使用的内核:

 grub2-editenv list    回显:saved_entry=CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)  with debugging


查看可以使用的内核:

 cat /boot/grub2/grub.cfg | grep 'menuentry '  回显:

menuentry 'CentOS Linux (5.18.1-1.el7.elrepo.x86_64) 7 (Core) with debugging' --class rhel fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-a1003f9f-2f89-4a7d-baea-d7e2d6b5088a' {
menuentry 'CentOS Linux (5.18.1-1.el7.elrepo.x86_64) 7 (Core)' --class rhel fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-a1003f9f-2f89-4a7d-baea-d7e2d6b5088a' {
menuentry 'CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core) with debugging' --class rhel fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-a1003f9f-2f89-4a7d-baea-d7e2d6b5088a' {
menuentry 'CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)' --class rhel fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-a1003f9f-2f89-4a7d-baea-d7e2d6b5088a' {


手动设置默认启动的内核:

 grub2-set-default 'CentOS Linux (5.18.1-1.el7.elrepo.x86_64) 7 (Core) '

查看设置后的结果:

 grub2-editenv list   回显: saved_entry=CentOS Linux (5.18.1-1.el7.elrepo.x86_64) 7 (Core)

reboot 重启生效。