查看可用内核
# 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)