centos7 选定默认启动内核,及删除无用内核
2023-09-27 14:25:55 时间
#使用cat /boot/grub2/grub.cfg |grep menuentry 查看系统可用内核
[root@bigapp-slave27 ~]# cat /boot/grub2/grub.cfg |grep menuentry
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {
menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {
menuentry 'CentOS Linux (0-rescue-d57307c454c0437d91c309347178cdf5) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-d57307c454c0437d91c309347178cdf5-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {
#查看当前内核
[root@bigapp-slave27 ~]# uname -r
3.10.0-514.16.1.el7.x86_64
#修改开机时默认使用的内核
grub2-set-default 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)'
#查看内核修改结果
[root@bigapp-slave27 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
#查看系统安装了哪些内核包
[root@bigapp-slave27 ~]# rpm -qa |grep kernel
kernel-3.10.0-327.el7.x86_64
kernel-headers-3.10.0-514.6.1.el7.x86_64
kernel-tools-libs-3.10.0-327.el7.x86_64
kernel-3.10.0-514.16.1.el7.x86_64
kernel-tools-3.10.0-327.el7.x86_64
#使用yum remove 或rpm -e 删除无用内核
yum remove kernel-3.10.0-327.el7.x86_64
相关文章
- centos7 搭建双网卡bond1(主备模式)实例
- CentOS7+CDH6.3安装CDH错误排查: HiveServer2 该角色的进程已退出。该角色的预期状态为已启动
- CentOS7 中使用 firewall-cmd端口转发以及常用命令
- CentOS7下JSP连接Mysql
- CentOS7清理老旧内核
- centos7 web服务器内核优化
- CentOS7 配置Docker非安全镜像仓库地址列表
- centos7 在docker swarm中运行Jenkins,利用gitlab的webhook触发自动部署脚本
- CENTOS7 添加自定义快捷键(启动TERMINAL,显示桌面等)
- CentOS7系列--5.3CentOS7中配置和管理Kubernetes
- CentOS7系列--1.4CentOS7服务
- CentOS7安装tomcat
- centos7 firewalled
- CentOS7查看和关闭防火墙
- CentOS7安装MySQL5.7常见问题
- Linux(Centos7)安装jdk