LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 907|回复: 13

请教一个grub2安装失败的问题。

[复制链接]
发表于 2011-11-20 10:35:03 | 显示全部楼层 |阅读模式
[color="Red"]使用安装盘修复了grub,但grub2仍然失败,继续求助

今天抽风想安装grub2,按照wiki安装下来,结果完蛋了,重启电脑之后只剩下一个光标了。现在电脑无法进入任何系统(幸亏我还有另外一台,否则连发帖求助都不行鸟),有没有办法解决

谢谢大家
发表于 2011-11-20 12:01:18 | 显示全部楼层
如果只是GRUB,可以试试在LIVECD里输入grub进入grub的命令行进行安装试试,grub2还真不知道要怎么搞,虽然我现在系统也是GRUB2
另,光标那可以输入不?
回复 支持 反对

使用道具 举报

发表于 2011-11-20 13:44:23 | 显示全部楼层
贴下grub.conf看。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-11-20 16:33:33 | 显示全部楼层
Post by panpanpdj;2155524
如果只是GRUB,可以试试在LIVECD里输入grub进入grub的命令行进行安装试试,grub2还真不知道要怎么搞,虽然我现在系统也是GRUB2
另,光标那可以输入不?


一开始我以为在安装grub2时删除了grub,可能无法用安装盘修复了。不过后来抱着试试看的想法试了一下,还真行。就是

  1. grub> root (hd0, 3)
  2. grub> setup (hd0)
复制代码


光标也不可输入
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-11-20 16:45:09 | 显示全部楼层
Post by 难免有错;2155532
贴下grub.conf看。
好的,是用menulst2cfg生成的
  1. # Config file for GRUB - The GNU GRand Unified Bootloader
  2. # /boot/grub/menu.lst
  3. # DEVICE NAME CONVERSIONS
  4. #
  5. #  Linux           Grub
  6. # -------------------------
  7. #  /dev/fd0        (fd0)
  8. #  /dev/sda        (hd0)
  9. #  /dev/sdb2       (hd1,1)
  10. #  /dev/sda3       (hd0,2)
  11. #
  12. #  FRAMEBUFFER RESOLUTION SETTINGS
  13. #     +-------------------------------------------------+
  14. #          | 640x480    800x600    1024x768   1280x1024
  15. #      ----+--------------------------------------------
  16. #      256 | 0x301=769  0x303=771  0x305=773   0x307=775
  17. #      32K | 0x310=784  0x313=787  0x316=790   0x319=793
  18. #      64K | 0x311=785  0x314=788  0x317=791   0x31A=794
  19. #      16M | 0x312=786  0x315=789  0x318=792   0x31B=795
  20. #     +-------------------------------------------------+
  21. #  for more details and different resolutions see
  22. #  http://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution
  23. # general configuration:
  24. set timeout=15
  25. set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi
  26. set color_normal='light-blue/black'; set color_highlight='light-cyan/blue'
  27. # boot sections follow
  28. # each is implicitly numbered from 0 in the order of appearance below
  29. #
  30. # TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
  31. #
  32. #-*
  33. # (0) Arch Linux
  34. menuentry 'Arch Linux' {
  35.   set root='(hd0,4)'; set legacy_hdbias='0'
  36.   legacy_kernel   '/boot/vmlinuz26' '/boot/vmlinuz26' 'root=/dev/sda4' 'ro'
  37.   legacy_initrd '/boot/kernel26.img' '/boot/kernel26.img'
  38.   
  39.   # (1) Arch Linux
  40. }
  41. menuentry 'Arch Linux Fallback' {
  42.   set root='(hd0,4)'; set legacy_hdbias='0'
  43.   legacy_kernel   '/boot/vmlinuz26' '/boot/vmlinuz26' 'root=/dev/sda4' 'ro'
  44.   legacy_initrd '/boot/kernel26-fallback.img' '/boot/kernel26-fallback.img'
  45.   
  46.   # (2) Windows
  47. }
  48. menuentry 'Windows' {
  49.   set root='(hd0,1)'; set legacy_hdbias='0'
  50.   parttool "$root" boot+
  51.   chainloader  '+1'
  52. }
复制代码
回复 支持 反对

使用道具 举报

发表于 2011-11-20 20:30:38 | 显示全部楼层
你grub的时候是(hd0,3),到了grub2怎么成(hd0,4)了,这样肯定启动不成吧
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-11-21 00:14:13 | 显示全部楼层
Post by panpanpdj;2155548
你grub的时候是(hd0,3),到了grub2怎么成(hd0,4)了,这样肯定启动不成吧


wiki上说grub2是从1开始,而grub是从0开始
  1. GRUB 和 GRUB2 的分区命名有变化。分区从 1开始编号,并以分区类型开始,原来是从 0 开始编号。注意:磁盘还是从 0 编号。例如,/dev/sda1 应该是 (hd0,msdos1) (用于MBR) 或 (hd0,gpt1) (用于 GPT)。
复制代码


当然也试过 (hd0,3),同样不行
回复 支持 反对

使用道具 举报

发表于 2011-11-21 11:15:53 | 显示全部楼层
这是我的,你看一下,我也没看出什么大的差别
==================================
set timeout=5
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved                            _entry"; fi
set color_normal='light-blue/black'; set color_highlight='light-cyan/blue'

if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode="1366x768x32"
  insmod gfxterm
  insmod vbe
  terminal_output gfxterm
  if terminal_output gfxterm; then true ; else
     terminal gfxterm
  fi
fi
insmod jpeg
background_image /boot/grub/archlinux.jpeg



# boot sections follow
# each is implicitly numbered from 0 in the order of appearance below
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

# (0) Arch Linux
menuentry 'Arch Linux' {
  set root='(hd0,9)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-linux' '/boot/vmlinuz-linux' 'root=/dev/sda9' '                            ro' 'logo.nologo' 'quiet' 'nomodeset' 'vga=0x323' 'console=tty1' 'splash=silent,                            fadein,fadeout,theme:arch-black'

  legacy_initrd '/boot/initramfs-linux.img' '/boot/initramfs-linux.img'

  # (1) Arch Linux
}

menuentry 'Arch Linux Fallback' {
  set root='(hd0,9)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-linux' '/boot/vmlinuz-linux' 'root=/dev/sda9' '                            ro'
  legacy_initrd '/boot/initramfs-linux-fallback.img' '/boot/initramfs-linux-fall                            back.img'

  # (2) Windows
}

menuentry 'Windows' {
  set root='(hd0,1)'; set legacy_hdbias='0'
  chainloader  '+1'
}
回复 支持 反对

使用道具 举报

发表于 2011-11-21 13:18:39 | 显示全部楼层
1、试着重新生成grub.cfg
  1. /sbin/grub-mkconfig  -o /boot/grub/grub.cfg
复制代码

2、新版linux内核启动名称发生了改变,请查看一下,是否与此有关。(如果你用上面的命令生成的菜单,不存在此问题)
News: Changes to kernel package and filenames

2011-08-07 - Dieter Plaetinck

Due to Linux kernel version 3.0 being moved into [core], the kernel26 package has been renamed to linux. Also, filenames of the kernel and initrd's have changed as follows:

    vmlinuz26 becomes vmlinuz-linux
    kernel26.img becomes initramfs-linux.img
    kernel26-fallback.img becomes initramfs-linux-fallback.img

To prevent you from breaking your system after the update, symlinks are created so that your bootloader configuration pointing to the old files will still work. However we recommend updating your bootloader configuration and deleting the symlinks afterwards.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-11-21 13:28:34 | 显示全部楼层
Post by 32idea;2155602
1、试着重新生成grub.cfg
  1. /sbin/grub-mkconfig  -o /boot/grub/grub.cfg
复制代码


2、新版linux内核启动名称发生了改变,请查看一下,是否与此有关。(如果你用上面的命令生成的菜单,不存在此问题)


好的,我试试。谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表