[user@levi ~]$ sudo cat /boot/grub2/grub.cfg |grep menuentry
[sudo] user 的密码:
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (3.10.0-1127.10.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.el7.x86_64-advanced-dab6beec-5c9d-44e8-8def-fc53433a2d7c' {
menuentry 'CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.el7.x86_64-advanced-dab6beec-5c9d-44e8-8def-fc53433a2d7c' {
menuentry 'CentOS Linux (0-rescue-e8af2a79032945b6a23f24f1fb8a7912) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-e8af2a79032945b6a23f24f1fb8a7912-advanced-dab6beec-5c9d-44e8-8def-fc53433a2d7c' {
查看当前内核
[user@levi ~]$ uname -r
3.10.0-693.el7.x86_64
修改开机时默认使用的内核
[user@levi ~]$ sudo grub2-set-default 'CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)'
查看内核修改结果
[user@levi ~]$ sudo grub2-editenv list
saved_entry=CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)
查看系统安装了哪些内核包
[user@levi ~]$ rpm -qa |grep kernel
abrt-addon-kerneloops-2.1.11-48.el7.centos.x86_64
kernel-3.10.0-1127.10.1.el7.x86_64
kernel-tools-3.10.0-1127.10.1.el7.x86_64
kernel-tools-libs-3.10.0-1127.10.1.el7.x86_64
kernel-tools-3.10.0-693.el7.x86_64
abrt-addon-kerneloops-2.1.11-57.el7.centos.x86_64
kernel-headers-3.10.0-1127.10.1.el7.x86_64
kernel-devel-3.10.0-1127.10.1.el7.x86_64
kernel-3.10.0-693.el7.x86_64
kernel-devel-3.10.0-693.el7.x86_64
kernel-tools-libs-3.10.0-693.el7.x86_64
kernel-headers-3.10.0-693.el7.x86_64
使用yum remove 或rpm -e 删除无用内核
[user@levi ~]$ sudo yum remove kernel-3.10.0-1127.10.1.el7.x86_64
已加载插件:fastestmirror, langpacks
正在解决依赖关系
......
参考:http://www.cnblogs.com/niyeshiyoumo/p/6762193.html