我最近刚刚在我的电脑上安装了 Linux Oplitex Gx280
。每次登录时,我都会看到 Grub 1.99 屏幕并选择(Ubuntu,带有Linux 3.5.0-34-generic
)。
我需要我的电脑自动启动,所以我调整了 /etc/default/grub 文件并set GRUB_TIMEOUT=3
运行了 update-grub。但是 Grub 菜单没有变化,并且发现没有超时,除非你选择一个选项,否则不会前进。
我甚至尝试过使用该GRUB_SAVEDEFAULT=true
行。我还从启动 CD 重新安装了 grub,但没有成功。重新安装后,我的 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="Ubuntu, with Linux 3.5.0-34-generic"
GRUB_HIDDEN_TIMEOUT="5"
GRUB_HIDDEN_TIMEOUT_QUIET="false"
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"
GRUB_DISABLE_OS_PROBER="true"
GRUB_SAVEDEFAULT="true"
请帮助我解决这个问题,请记住,我对 Linux 还很陌生,谢谢
答案1
我已经回答了我的问题。显然,Ubuntu 在某个时候没有正确关闭。在这种情况下,Grub 默认进入选择页面并强迫您选择。在这种情况下到达此屏幕的错误也被认为是不恰当的,恶性循环开始导致您总是到达 Grub 启动屏幕并且总是必须手动做出选择。
要解决此问题,您必须编辑 /etc/grub.d/00_header 并编辑记录失败部分以
if\${recordfail} = 1 ]; then
set timeout=${GRUB_TIMEOUT}
else
set timeout=${GRUB_TIMEOUT}
fi
EOF
这意味着如果出现任何故障,它将在你在 /etc/default/grub 中指定的 GRUB_TIMEOUT 时间后继续运行。然后运行sudo update-grub
在您编辑此内容之前,它可能会显示类似于 RECORD_FAIL 的内容(我不记得它具体说了什么,后来我编辑了我的内容),并带有 -1。那个 -1 时间值迫使我手动做出选择。您可能只需将 -1 编辑为某个时间值,但将其更改为上面显示的值肯定会解决问题。
答案2
您是否尝试过这个:
GRUB_TIMEOUT="0"
我刚刚试过了,有效。我的“ hidden grub timeout
”中也有 0
这是我的 grub:
firekage@deusex:~$ cat /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=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
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"