分页: 1 / 1

无法修复grub

发表于 : 2009-02-23 12:17
yision
前几天重装了xp 我就拿出7.10的live cd来修复grub (我的系统是xp+ubuntu8.10)

(分区是 一个dell的诊断程序 ,xp,xp的d盘,然后逻辑分区 (swap, / ,/home) )

代码: 全选

sudo grub   

代码: 全选

grub> find /boot/grub/stage1

Error 15: File not found
grub> root (hd0,6)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 2: Bad file or directory type
我也试过在 输入 root(hd0, 以后按tab键 试了每一个分区都不行

没办法我又去找了grub4dos 然后把 menu.lst复制到c盘下

引导xp没有问题 但是引导ubuntu 就出现Error 15:File not found

然后我把引导 xp的那个选项改成root (hd0,6) 得到错误Error 12 : Invalid device requested

我的menu.lst

代码: 全选

title        Ubuntu 8.10, kernel 2.6.27-11-generic
uuid        77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel        /boot/vmlinuz-2.6.27-11-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro quiet splash
initrd        /boot/initrd.img-2.6.27-11-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-11-generic (recovery mode)
uuid        77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel        /boot/vmlinuz-2.6.27-11-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro single
initrd        /boot/initrd.img-2.6.27-11-generic

title        Ubuntu 8.10, kernel 2.6.27-9-generic
uuid        77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro quiet splash
initrd        /boot/initrd.img-2.6.27-9-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-9-generic (recovery mode)
uuid        77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro single
initrd        /boot/initrd.img-2.6.27-9-generic

title        Ubuntu 8.10, memtest86+
uuid        77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Dell Utility Partition
root        (hd0,1)
savedefault
makeactive
chainloader    +1
不知道是什么问题 :em20 大家帮我看下

Re: 无法修复grub

发表于 : 2009-02-24 1:37
vmmm
grub> root (hd0,6)把6改为5。分区是从0算起的

Re: 无法修复grub

发表于 : 2009-02-24 1:58
mymathersname
标记,飘过…… :em06

Re: 无法修复grub

发表于 : 2009-02-24 13:59
yision
grub> root (hd0,6)把6改为5。分区是从0算起的
Error 17 : Cannot mount selected partition

:em20

我的fstab

代码: 全选

# /etc/fstab: static file system information.

#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0

# /dev/sda7
UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 /               ext3    relatime,errors=remount-ro 0       1

# /dev/sda8
UUID=f0b96f7a-505c-4d99-95b0-2db89ab2961b /home           ext3    relatime        0       2

# /dev/sda6
UUID=5d89d1b1-d4d6-4220-b75a-f6d2c8e80d92 none            swap    sw              0       0

Re: 无法修复grub

发表于 : 2009-02-24 17:32
yision
进了 lin 了


也怪自己懒 不认真 看看 menu.lst

不知道 那些直接把menu.lst 复制到c盘下的人是怎么成功引导的

我加了个路径才进的去的

代码: 全选

title        Ubuntu 8.10, kernel 2.6.27-11-generic
uuid        77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel        (hd0,6)/boot/vmlinuz-2.6.27-11-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro quiet splash
initrd        (hd0,6)/boot/initrd.img-2.6.27-11-generic
quiet
(hd0,6)是我 加上的



但是 我还是不清楚为什么用live cd 修复的时候

代码: 全选

grub> find /boot/grub/stage1

Error 15: File not found
grub> root (hd0,6)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 2: Bad file or directory type
请高手指点下,因为看见很多朋友都有这个问题但是没有解决 ,他们多半不是直接重装就是直接放弃ubuntu了

Re: 无法修复grub

发表于 : 2009-02-24 17:51
adagio
grub4dos不支持用uuid指定根分区,只能写成

代码: 全选

title        Ubuntu 8.10, kernel 2.6.27-11-generic
root (hd0,6)
kernel        /boot/vmlinuz-2.6.27-11-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro quiet splash
initrd        /boot/initrd.img-2.6.27-11-generic
quiet
如果安装gnu grub 0.97(即用liveCD安装的grub)就可以写成

代码: 全选

title        Ubuntu 8.10, kernel 2.6.27-11-generic
uuid        77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel       /boot/vmlinuz-2.6.27-11-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro quiet splash
initrd        /boot/initrd.img-2.6.27-11-generic
quiet
另外,你用liveCD安装grub失败,说明原来的grub肯定有问题,自己检查一下(hd0,6)有没有/grub或者/boot/grub这个目录就知道了

ps:用grub4dos也一样,不必非要gnu grub

Re: 无法修复grub

发表于 : 2009-02-24 20:41
yision
哈哈 谢谢ls 原来不支持uuid

但是 开发者可能考虑到了 会有我这样乱来的人
title Ubuntu 8.10, kernel 2.6.27-11-generic
uuid 77bcfcdc-509c-4153-8e75-eb198bd3c832
kernel (hd0,6)/boot/vmlinuz-2.6.27-11-generic root=UUID=77bcfcdc-509c-4153-8e75-eb198bd3c832 ro quiet splash
initrd (hd0,6)/boot/initrd.img-2.6.27-11-generic
quiet
所以这样 也行了 运气不错


我看了 有/boot/grub 里面的东西应该都是全的 但是不知道为什么装不上 其他人应该也有遇到 :em20

Re: 无法修复grub

发表于 : 2009-02-25 19:04
billbear
File not found 的问题就出在你拿了 7.10 的 livecd 去修复 8.10 的 grub。
而 7.10 的 grub 是不能识别 8.10 的新式 ext3 分区的, 8.10 的 ext3 分区格式不同以往, inode size 变成 256 字节了。
现在你已经用 grub4dos 引导了,就不必再弄了,如果要弄的话,现在不需要 livecd 了,直接在 ubuntu 8.10 底下弄就可以了。

grub4dos 的问题,一是你的版本不够新(但好像也不太旧,因为它可以读取新的 ext3),不能识别 uuid 命令,
二是你画蛇添足地拷贝了 menu.lst 到 c 盘,否则即使不能识别 uuid 命令,root (hdx,y) 隐含的默认值也是 menu.lst 所在分区,就是 linux 分区,这就对了。现在隐含的默认值变成了 xp 分区,所以你要加上 (hd0,6) 来指定。
用 grub4dos 引导 linux 不需要从 linux 分区拷贝任何文件,因为 grub4dos 识别所有的 linux 分区,会使用 linux 本身的 menu.lst。你所要做的仅是拷贝 grldr,修改 boot.ini 而已。网上乱七八糟的教程误人不浅啊。

Re: 无法修复grub

发表于 : 2009-02-26 16:58
yision
哈哈 谢谢ls指点
我觉得大概可能就是我拿7.10 的 livecd 去修复 8.10 的 grub 出现的问题,但没8.10的盘 就没有验证

我进了ubuntu就修复好了

的确害人不浅 我也不仔细,心想他们能行 ,为什么我就不行 :em04

Re: 无法修复grub

发表于 : 2010-01-21 14:10
hyx979
诲人不倦