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
  • 相关阅读:
    day5 页面布局
    1、rbac权限组件-初识, 中间件校验1
    1 、算法-总结
    10 腾讯云、django2.0、uwsgi、mysql、nginx 部署
    9 README,全套代码
    8 功能6:后台管理页面,编辑文章,xss攻击
    3-面试篇-操作系统
    7 功能5:文章详情页、评论、评论树
    6 功能4:文章详情页、点赞功能
    2- 面试篇-数据库
  • 原文地址:https://www.cnblogs.com/lyss/p/12356893.html
Copyright © 2011-2022 走看看