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
  • 相关阅读:
    [读书笔记]黑客与画家[Hackers.and.Painters]
    android电池充电以及电量检测驱动分析
    LV在系统重启后不能自动激活(boot.lvm&after.loca)
    线段树菜鸟一题+归并排序【求逆序数】POJ2299
    【PAT】1035. Password (20)
    Android应用开发学习笔记之ContentProvider
    UVAlive 2322 Wooden Sticks(贪心)
    卸载QTP
    线段树模板
    2013 CSU校队选拔赛(1) 部分题解
  • 原文地址:https://www.cnblogs.com/lyss/p/12356893.html
Copyright © 2011-2022 走看看