1
vking 2014-01-21 07:57:07 +08:00 via Android 1
我的vps也是这样,不过无所谓,反正几个月都重启不了几次。
|
3
passluo 2014-01-21 08:05:54 +08:00 via Android 1
把hidden time out 设置个时间,再更新一下grub设置就可以了,我之前在机房给服务器装Ubuntu也是这个样子的…不知道为什么…
|
4
andybest OP |
5
jkeylu 2014-01-21 08:27:58 +08:00 via Android 1
你最近有添加什么服务开机启动的吗?很有可能是这个服务的启动脚本有问题才这样,起码以前我遇到的是这个情况!
|
6
Esay 2014-01-21 08:30:40 +08:00 1
|
7
andybest OP @jkeylu 就是新安装的系统,因为VPS服务器意外宕机导致无法进入系统,提供商帮我重新安装了GRUB后成了这样,我没安装过任何东西。
|
8
Esay 2014-01-21 08:32:47 +08:00 1
|
10
xiiing 2014-01-21 08:54:56 +08:00 1
# 这是我这台电脑的grub.cfg,也是10.04,或许可以参考
# 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="0" 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,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 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,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 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-55-generic' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 linux /boot/vmlinuz-2.6.32-55-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro quiet splash initrd /boot/initrd.img-2.6.32-55-generic } menuentry 'Ubuntu, with Linux 2.6.32-55-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 echo 'Loading Linux 2.6.32-55-generic ...' linux /boot/vmlinuz-2.6.32-55-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro single echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-2.6.32-55-generic } menuentry 'Ubuntu, with Linux 2.6.32-54-generic' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 linux /boot/vmlinuz-2.6.32-54-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro quiet splash initrd /boot/initrd.img-2.6.32-54-generic } menuentry 'Ubuntu, with Linux 2.6.32-54-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 echo 'Loading Linux 2.6.32-54-generic ...' linux /boot/vmlinuz-2.6.32-54-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro single echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-2.6.32-54-generic } menuentry 'Ubuntu, with Linux 2.6.32-53-generic' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 linux /boot/vmlinuz-2.6.32-53-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro quiet splash initrd /boot/initrd.img-2.6.32-53-generic } menuentry 'Ubuntu, with Linux 2.6.32-53-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 echo 'Loading Linux 2.6.32-53-generic ...' linux /boot/vmlinuz-2.6.32-53-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro single echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-2.6.32-53-generic } menuentry 'Ubuntu, with Linux 2.6.32-52-generic' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 linux /boot/vmlinuz-2.6.32-52-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro quiet splash initrd /boot/initrd.img-2.6.32-52-generic } menuentry 'Ubuntu, with Linux 2.6.32-52-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 echo 'Loading Linux 2.6.32-52-generic ...' linux /boot/vmlinuz-2.6.32-52-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro single echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-2.6.32-52-generic } menuentry 'Ubuntu, with Linux 2.6.32-33-generic' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 linux /boot/vmlinuz-2.6.32-33-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro quiet splash initrd /boot/initrd.img-2.6.32-33-generic } menuentry 'Ubuntu, with Linux 2.6.32-33-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 echo 'Loading Linux 2.6.32-33-generic ...' linux /boot/vmlinuz-2.6.32-33-generic root=UUID=6cc30560-a6f7-449b-bafe-2ae045026d04 ro single echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-2.6.32-33-generic } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_memtest86+ ### menuentry "Memory test (memtest86+)" { insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 linux16 /boot/memtest86+.bin } menuentry "Memory test (memtest86+, serial console 115200)" { insmod ext2 set root='(hd0,4)' search --no-floppy --fs-uuid --set 6cc30560-a6f7-449b-bafe-2ae045026d04 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 ### |
11
juicy 2014-01-21 08:58:00 +08:00 via Android 1
|
12
andybest OP @juicy 谢谢,/etc/default/grub 这个文件中的参数,各种组合我都试了(编辑完执行 sudo update-grub 后重启)
比如: GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=0 GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=false GRUB_TIMEOUT=0 GRUB_DEFAULT=1 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=3 #GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=3 等等... 我把这几个参数依次改了个遍,但每次重启仍然是停在 GNU GRUB 菜单 这些参数没有起到任何作用... |
13
Esay 2014-01-21 09:16:02 +08:00 1
额,GITHUB GIST 粘贴一下 /etc/grub.d/10_linux,我可以帮你试着改一下。
|
14
andybest OP |
15
Esay 2014-01-21 09:49:07 +08:00 1
手边也没有Linux,不能帮你试试。
1. 130 行改为 if [ "x$list" != "x" ] ; then 2. 165 行改为 fi 3. /boot/grub/grub.cfg 里加上 GRUB_DISABLE_LINUX_RECOVERY=true 4. sudo update-grub 我也是猜着改的,应该只留下一个选项了。你试下吧,看下啥结果。 |
16
andybest OP @Esay 谢谢。。但我 VPS 上有重要的数据,真是不太敢改怕启动不起来了
我看其他同样配置的 VPS 的 /etc/grub.d/10_linux 并没有这样的改动, 为什么就这一台会出现这种问题(/etc/default/grub不生效) 就是为什么与同配置的其他机器 /etc/default/grub /boot/grub/grub.cfg /etc/grub.d/10_linux 这三个文件完全一致,这台机器重启会停在 GRUB 而其他机器不会 并不是一定要用各种手段隐藏掉 GRUB 选择界面,而是想知道知道为什么,从而解决。 谢谢 |
18
Ansen 2014-01-21 10:35:25 +08:00 1
试试让系统重新生成/boot/grub/grub.cfg
#update-grub |
19
harmy 2014-01-21 12:59:44 +08:00 1
sudo vim /etc/default/grub
添加这行: GRUB_RECORDFAIL_TIMEOUT=2 然后再: sudo update-grub |
20
andybest OP @Ansen 谢谢,重新生成并重启了,但还是卡在 GRUB 选择菜单没有效果:
# ls /boot/grub/grub.cfg -l -r--r--r-- 1 root root 2681 Jan 21 09:20 /boot/grub/grub.cfg # # # grub-mkconfig -o /boot/grub/grub.cfg Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-49-generic-pae Found initrd image: /boot/initrd.img-2.6.32-49-generic-pae Found memtest86+ image: /boot/memtest86+.bin done # ls /boot/grub/grub.cfg -l -r--r--r-- 1 root root 2681 Jan 22 01:25 /boot/grub/grub.cfg # date Wed Jan 22 01:25:16 CST 2014 # update-grub Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-49-generic-pae Found initrd image: /boot/initrd.img-2.6.32-49-generic-pae Found memtest86+ image: /boot/memtest86+.bin done # sudo update-grub Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-49-generic-pae Found initrd image: /boot/initrd.img-2.6.32-49-generic-pae Found memtest86+ image: /boot/memtest86+.bin done # |