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

    #使用cat /boot/grub2/grub.cfg |grep menuentry  查看系统可用内核

    root@Cs7-sh-03:/root> 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-693.2.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.21.1.el7.x86_64-advanced-58ebcc18-06a4-454a-a772-4f583085b996' {
    menuentry 'CentOS Linux (3.10.0-514.21.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.21.1.el7.x86_64-advanced-58ebcc18-06a4-454a-a772-4f583085b996' {
    menuentry 'CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.el7.x86_64-advanced-58ebcc18-06a4-454a-a772-4f583085b996' {
    menuentry 'CentOS Linux (0-rescue-8d13a50988cc5c4972347415eddf7d47) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-8d13a50988cc5c4972347415eddf7d47-advanced-58ebcc18-06a4-454a-a772-4f583085b996' { 

    #查看当前内核

    root@Cs7-sh-03:/root> uname -r 
    3.10.0-514.21.1.el7.x86_64

    #修改开机时默认使用的内核

    grub2-set-default 'CentOS Linux (3.10.0-693.2.2.el7.x86_64) 7 (Core)'

    #查看内核修改结果

    root@Cs7-sh-03:/root> grub2-editenv list 17-10-10 14:21
    saved_entry=CentOS Linux (3.10.0-693.2.2.el7.x86_64) 7 (Core)

    #查看系统安装了哪些内核包

    root@Cs7-sh-03:/root> rpm -qa |grep kernel
    kernel-3.10.0-514.el7.x86_64
    kernel-3.10.0-514.21.1.el7.x86_64
    kernel-debug-devel-3.10.0-693.2.2.el7.x86_64
    abrt-addon-kerneloops-2.1.11-48.el7.centos.x86_64
    kernel-tools-libs-3.10.0-693.2.2.el7.x86_64
    kernel-tools-3.10.0-693.2.2.el7.x86_64
    kernel-headers-3.10.0-693.2.2.el7.x86_64
    kernel-3.10.0-693.2.2.el7.x86_64

    #使用yum remove 或rpm -e 删除无用内核

    yum remove kernel-3.10.0-514.21.1.el7.x86_64

    参考:http://www.cnblogs.com/niyeshiyoumo/p/6762193.html

  • 相关阅读:
    简单了解Linux文件目录
    解决GitLab的Forbidden和Nginx启动失败
    浅谈apidoc的使用
    Linux安装apidoc
    DevExpress的GridControl的实时加载数据解决方案(取代分页)
    Devexpress使用经验1
    ajax下载文件
    var str = "1,21,".TrimEnd(',');
    MSSQ调优所需用的语句
    js中替换返回json中的空格为 
  • 原文地址:https://www.cnblogs.com/lazyfang/p/7645438.html
Copyright © 2011-2022 走看看