我有一个Ubuntu Server 11.04,但它是无头的(没有显示器)。我想通过SSH远程访问它。但是,有时候,比如在断电后,当服务器重新启动时,它会卡在Grub引导菜单上,不会倒计时。它只会停在那里等待我选择第一个引导项。这意味着我必须去那里插入显示器和键盘。
但是我无法远程操作。我该如何强制它继续引导到引导项1(默认)而不受断电或其他因素的影响?
但是我无法远程操作。我该如何强制它继续引导到引导项1(默认)而不受断电或其他因素的影响?
/etc/default/grub
来覆盖recordfail超时时间。GRUB_TIMEOUT=10
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT
sudo update-grub
来应用更改。
grub2 (1.99-21ubuntu3.3) precise-proposed; urgency=low
[ Ben Howard ]
* Parameterization of recordfail setting. This allows users to define the
default time out of GRUB when recordfail has been set. The curren
setting causes hangs on headless and appliances where access to the
console is limited or prohibited. (LP: #669481) [1]
-- Louis Bouchard <louis.bouchard@canonical.com> Tue, 21 Aug 2012 10:51:58 +0200
/etc/grub.d/00_header
中找到。make_timeout ()
{
cat << EOF
if [ "\${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=${2}
fi
EOF
}
set timeout=10
。make_timeout ()
{
cat << EOF
if [ "\${recordfail}" = 1 ]; then
set timeout=10
else
set timeout=${2}
fi
EOF
}
sudo update-grub2