CentOS7调整开机启动选择的kerner菜单
CentOS7调整开机启动选择的kerner菜单
生成的文件/boot/grub2/grub.cfg,但是不要修改该文件
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
需要修改文件:
[root@oracle-server ~]# vim /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
#GRUB_DEFAULT=saved
GRUB_DEFAULT=1 #修改这个default的值,开机启动的菜单,第一个菜单数字是0,依次类推,若改为 saved,则默认为上次启动项
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
修改完内容后执行 update-grub,然后reboot重启