1\查看当前系统有几个内核
# cat /boot/grub2/grub.cfg |grep menuentry

比如:
menuentry ‘CentOS Linux (4.13.7-1.el7.elrepo.x86_64) 7 (Core)’ –class centos –class gnu-linux –class gnu –class os –unrestricted 、$menuentry_id_option ‘gnulinux-4.9.0-advanced-5b8cbedb-133e-4d4d-bf26-07c08d17a4e6’ {
menuentry ‘CentOS Linux (3.10.0-693.2.2.el7.x86_64) 7 (Core)’ –class centos –class gnu-linux –class gnu –class os –unrestricted $menuentry_id_option ‘gnulinux-4.9.0-advanced-5b8cbedb-133e-4d4d-bf26-07c08d17a4e6’ {
menuentry ‘CentOS Linux (4.8.0) 7 (Core)’ –class centos –class gnu-linux –class gnu –class os –unrestricted menuentry_id_option ‘gnulinux-4.9.0-advanced-5b8cbedb-133e-4d4d-bf26-07c08d17a4e6’ {  
menuentry ‘CentOS Linux (4.9.0) 7 (Core)’ –class centos –class gnu-linux –class gnu –class os –unrestricted
menuentry_id_option ‘gnulinux-4.9.0-advanced-5b8cbedb-133e-4d4d-bf26-07c08d17a4e6’ {
menuentry ‘CentOS Linux (4.9.0.old) 7 (Core)’ –class centos –class gnu-linux –class gnu –class os –unrestricted $menuentry_id_option ‘gnulinux-4.9.0.old-advanced-5b8cbedb-133e-4d4d-bf26-07c08d17a4e6’ {
menuentry ‘CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)’ –class centos –class gnu-linux –class gnu –class os –unrestricted \$menuentry_id_option ‘gnulinux-3.10.0-514.el7.x86_64-advanced-5b8cbedb-133e-4d4d-bf26-07c08d17a4e6’ {
menuentry ‘CentOS Linux (0-rescue-57c81a796b7f45b082f2ac8dd4a263b3) 7 (C

2、设置默认的启动内核
# grub2-set-default “CentOS Linux (4.13.7-1.el7.elrepo.x86_64) 7 (Core)”
3、验证是否修改成功
# grub2-editenv list
4、reboot

Logo

更多推荐