zoukankan      html  css  js  c++  java
  • Centos7修改默认启动内核

    1,查看当前内核

    [root@centos7 ~]# uname -r
    

    2、查看启动配置里有哪些内核

    [root@centos7 ~]# 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 (5.5.3) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.5.3-advanced-6f7f36a5-b362-4eea-8401-0198f71af7c1' {
    menuentry 'CentOS Linux (3.10.0-1062.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1062.el7.x86_64-advanced-6f7f36a5-b362-4eea-8401-0198f71af7c1' {
    menuentry 'CentOS Linux (0-rescue-d45ac2c225fa4e8299b70b9f76a0dde9) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-d45ac2c225fa4e8299b70b9f76a0dde9-advanced-6f7f36a5-b362-4eea-8401-0198f71af7c1' {
    [root@centos7 ~]# 

    3, 修改默认启动项

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

    在查看启动配置里,第一个内核的序号是 0 ,第二个是 1 ,...........以此往后数字,以此选择需要的数字

    4,查看设置的结果

    [root@centos7 ~]# grub2-editenv list
    saved_entry=1
    [root@centos7 ~]# uname -r
    3.10.0-1062.el7.x86_64
    [root@centos7 ~]#

    5,最后,更新grub.cfg后 ,,,,重新启动

    [root@centos7 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-5.5.3
    Found initrd image: /boot/initramfs-5.5.3.img
    Found linux image: /boot/vmlinuz-3.10.0-1062.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-1062.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-d45ac2c225fa4e8299b70b9f76a0dde9
    Found initrd image: /boot/initramfs-0-rescue-d45ac2c225fa4e8299b70b9f76a0dde9.img
    done
    [root@centos7 ~]# reboot
  • 相关阅读:
    向TRichEdit插入图片的单元
    等待程序结束后, 自动启动程序的批处理
    执行程序函数
    基于IWICImage的截图代码
    线程中WICImage与Bitmap数据转换
    清理win10过期补丁的命令
    [转] 常见的哈希函数
    豆瓣小组爬虫.....^_^
    如何在ASP.NET Core中实现CORS跨域
    在ASP.NET Core中使用Angular2,以及与Angular2的Token base身份认证
  • 原文地址:https://www.cnblogs.com/lyss/p/12356893.html
Copyright © 2011-2022 走看看