AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 5116
Accepted
Will
Will
Asked: 2010-10-04 03:04:09 +0800 CST2010-10-04 03:04:09 +0800 CST 2010-10-04 03:04:09 +0800 CST

Grub 启动进入恢复模式

  • 772

当我启动 grub 时不显示(仅安装了 ubuntu),我希望 grub 显示一秒钟或 2 秒(shift 似乎没有显示它)。我的主要问题是 grub 启动到我认为是恢复模式,我可以以自己和 startx 身份登录,但这显然是一个正确的痛苦。有人可以告诉我如何解决这个问题吗?

Grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="1"
if [ ${prev_saved_entry} ]; then
  set saved_entry=${prev_saved_entry}
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd0,6)'
    search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
    linux   /boot/vmlinuz-2.6.32-25-generic root=UUID=1cd98d8a-97b3-4f25-9da2-e7128ef6dcba ro   quiet splash
    initrd  /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd0,6)'
    search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
    echo    'Loading Linux 2.6.32-25-generic ...'
    linux   /boot/vmlinuz-2.6.32-25-generic root=UUID=1cd98d8a-97b3-4f25-9da2-e7128ef6dcba ro single 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd0,6)'
    search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
    linux   /boot/vmlinuz-2.6.32-21-generic root=UUID=1cd98d8a-97b3-4f25-9da2-e7128ef6dcba ro   quiet splash
    initrd  /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd0,6)'
    search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
    echo    'Loading Linux 2.6.32-21-generic ...'
    linux   /boot/vmlinuz-2.6.32-21-generic root=UUID=1cd98d8a-97b3-4f25-9da2-e7128ef6dcba ro single 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod ext2
    set root='(hd0,6)'
    search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
    linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod ext2
    set root='(hd0,6)'
    search --no-floppy --fs-uuid --set 1cd98d8a-97b3-4f25-9da2-e7128ef6dcba
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###
grub2 recovery-mode
  • 2 2 个回答
  • 3730 Views

2 个回答

  • Voted
  1. Best Answer
    andrewsomething
    2010-10-04T08:56:01+08:002010-10-04T08:56:01+08:00

    /boot/grub/grub.cfg不应该直接编辑。相反,GRUB_TIMEOUT可以在/etc/default/grub以下是该文件的示例:

    # If you change this file, run 'update-grub' afterwards to update
    # /boot/grub/grub.cfg.
    
    GRUB_DEFAULT=0
    #GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX=""
    
    # 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_LINUX_RECOVERY="true"
    
    # Uncomment to get a beep at grub start
    #GRUB_INIT_TUNE="480 440 1"
    

    GRUB_DEFAULT设置默认菜单项。例如,GRUB_DEFAULT=0突出显示第一个菜单项。1 将是第二个。也许恢复会话设置为默认值?

    在只有一个操作系统的机器上,比如你GRUB_HIDDEN_TIMEOUT=0的,隐藏菜单。确保此行已被注释。如果存在多个操作系统,则忽略此设置。还要确保该GRUB_TIMEOUT值大于 0。这是在默认条目自动引导之前的秒数。

    /etc/default/grub确保在进行任何更改后运行sudo update-grub以更新您的配置。

    更多详情可在这找到:

    https://help.ubuntu.com/community/Grub2

    • 7
  2. fivef
    2014-06-26T04:00:19+08:002014-06-26T04:00:19+08:00

    接受的答案对我不起作用。我通过执行以下操作禁用了恢复菜单:

    /etc/default/grub用编辑器打开

    添加这一行:

    GRUB_RECORDFAIL_TIMEOUT=5
    

    更新蛴螬:

    sudo update-grub
    

    所以菜单只显示 5 秒钟,然后启动过程继续。

    • 0

相关问题

  • 有没有办法从 GUI/桌面管理我的 Grub 菜单选项?

  • grub 菜单中的“恢复”选项是什么?

  • 与 Grub 相比,使用 Grub2 有什么好处?

  • 如果旧版 grub 安装在引导分区扇区而不是 MBR 中,如何将 grub 更新为 grub2?

  • 如何在 Ubuntu 启动时显示或隐藏启动消息?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何安装 .run 文件?

    • 7 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    如何获得 CPU 温度?

    • 21 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Marko Smith

    如何使用命令行将用户添加为新的 sudoer?

    • 7 个回答
  • Marko Smith

    更改文件夹权限和所有权

    • 9 个回答
  • Marko Smith

    你如何重新启动Apache?

    • 13 个回答
  • Marko Smith

    如何卸载软件?

    • 11 个回答
  • Marko Smith

    如何删除 PPA?

    • 26 个回答
  • Martin Hope
    NES 如何启用或禁用服务? 2010-12-30 13:03:32 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    Olivier Lalonde 如何在结束 ssh 会话后保持进程运行? 2010-10-22 04:09:13 +0800 CST
  • Martin Hope
    David B 如何使用命令行将用户添加为新的 sudoer? 2010-10-16 04:02:45 +0800 CST
  • Martin Hope
    Hans 如何删除旧内核版本以清理启动菜单? 2010-08-21 19:37:01 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve