Gab*_*iel 13 dual-boot boot arch-linux grub2
我目前正在尝试各种发行版,所以当我启动我的笔记本电脑时,我有几个操作系统可供选择。通常,所有这些发行版都安装grub2并位于列表顶部,因此它们是安装完成后启动的默认发行版。
但 Manjaro 做了一些不同的事情。它安装了一些版本,grub2它会记住我上次启动的发行版并继续启动那个发行版(重新启动时),直到我选择另一个发行版(然后它会启动那个发行版等等)。
这是我想象的吗?Manjaro 真的会这样做吗?如果是这样,我怎么能安装该版本的grub到我的系统?干杯。
这是我的/etc/grub.d/40_custom文件:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
Run Code Online (Sandbox Code Playgroud)
这是我的/etc/default/grub文件:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Run Code Online (Sandbox Code Playgroud)
don*_*sti 13
根据GRUB 手册:
'GRUB_DEFAULT'
………………
如果您将此设置为“已保存”,则默认菜单项将是由“GRUB_SAVEDEFAULT”、grub-set-default 或 grub-reboot 保存的菜单项。
'GRUB_SAVEDEFAULT'
如果此选项设置为“true”,则在选择条目时,将其保存为新的默认条目,以供将来运行 GRUB 使用。这仅在 'GRUB_DEFAULT=saved' 时有用;这是一个单独的选项,因为 'GRUB_DEFAULT=saved' 在没有这个选项的情况下很有用,与 grub-set-default 或 grub-reboot 结合使用。默认取消设置。此选项依赖于环境块,它可能并非在所有情况下都可用(请参阅环境块)。
您必须添加:
GRUB_DEFAULT=saved
和
GRUB_SAVEDEFAULT=true
到您的/etc/default/grub. 此外,如果您使用自定义菜单文件,则/etc/grub.d/40_custom必须添加选项
savedefault
到该文件中的菜单项/菜单项。更新 GRUB 之后:
grub-mkconfig -o /boot/grub/grub.cfg
或者
update-grub
如果您安装了多个发行版,请确保您正在配置和更新活动的GRUB。
| 归档时间: |
|
| 查看次数: |
16069 次 |
| 最近记录: |