linux 7.x 切换内核

安装系统后发现该国产服务器不支持oracle linux uek内核,只得切换到redhat内核。

[root@db1 ~]#  uname -a
Linux db1 5.4.17-2011.6.2.el7uek.x86_64 #2 SMP Thu Sep 3 14:09:14 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux
 
[root@db1 ~]#  awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : Oracle Linux Server (5.4.17-2011.6.2.el7uek.x86_64 with Unbreakable Enterprise Kernel) 7.9
1 : Oracle Linux Server (3.10.0-1160.el7.x86_64 with Linux) 7.9
2 : Oracle Linux Server (0-rescue-57724e4d2a064aaeabe79777a393dd73 with Linux) 7.9

[root@db1 ~]# grub2-set-default 1

[root@db1 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
sed: can't read /etc/system-release: No such file or directory

解决方法:
[root@db1 ~]# cp /etc/redhat-release /etc/redhat-release.bak
[root@db1 ~]# mv /etc/redhat-release /etc/oracle-release

解决后再次执行

[root@db1 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.17-2102.201.3.el7uek.x86_64
Found initrd image: /boot/initramfs-5.4.17-2102.201.3.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1160.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1160.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-2f30d4e108e947abbe8c295cfc5d8716
Found initrd image: /boot/initramfs-0-rescue-2f30d4e108e947abbe8c295cfc5d8716.img

done
[root@db1 ~]# reboot

重启后查看

[root@db1 ~]# uname -a
Linux db1 3.10.0-1160.el7.x86_64 #1 SMP Thu Oct 1 17:21:35 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@db1 ~]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值