• CentOS7重新生成 /boot/grub2/grub.cfg


    CentOS7重新生成 /boot/grub2/grub.cfg

    CentOS7 is using grub2 and the generated /boot/grub2/grub.cfg rather than the old grub.confformat, which is why you can't find it. The new grub.cfg file is not intended for direct editing, instead you need to modify the source files that are used to generate it.

    The files in question are /etc/default/grub and the scripts in /etc/grub.d/. In particular, if you are looking to add your own custom entries, then you will want to append a boot stanza to /etc/grub.d/40_custom. The stanza will look something like this:

    menuentry "My custom boot entry" {
            set root=(hd0,1)
            linux /vmlinuz-3.11-custom
            initrd /initrd-plymouth.img
        }
    

    You can add the usual options to the linux line to pass in custom options to the kernel. Once you have everything looking the way you want it to, you run:

    grub2-mkconfig --output=/boot/grub2/grub.cfg
    

    Then, if you want to alter the default boot entry, you change the GRUB_DEFAULT option in /etc/default/grub to point to the new stanza you added, by zero indexed position or by name (I prefer name), something like this:

    GRUB_DEFAULT="My custom boot entry"

    修改/etc/default/grub
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet"
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto enforcing=0 vconsole.keymap=us rhgb quiet"
    添加
    enforcing=0
    存盘退出
    执行 grub2-mkconfig --output /boot/grub2/grub.cfg

    OK

  • 相关阅读:
    springBoot(3)---目录结构,文件上传
    springBoot(2)---快速创建项目,初解jackson
    VueJs(14)---理解Vuex
    VueJs(13)---过滤器
    VueJs(12)---vue-router(导航守卫,路由元信息,获取数据)
    php多进程中的阻塞与非阻塞
    php 中的信号处理
    dede中arcurl的解析
    dede5.7 GBK 在php5.4环境下 后台编辑器无法显示文章内容
    php5.3 php-fpm 开启 关闭 重启
  • 原文地址:https://www.cnblogs.com/lsgxeva/p/8918589.html
Copyright © 2020-2023  润新知