LinuxSir.cn,穿越时空的Linuxsir!

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

LILO竟然比GRUB强!闷!望高人指点江山。

[复制链接]
发表于 2004-6-2 15:25:07 | 显示全部楼层 |阅读模式
1、今早开电脑,选择WindowsXP没想到还没启动完成,停电。半小时过后,供电恢复,进XP,启动未完成,XP崩溃,重启XP,依然崩溃。用XP安装盘启动想重装一遍,选"L"怕丢失数据,重启。
2、这时重启时MBR已被清除,XP、Linux都进不去,"十分脑火",用红帽安装盘进rescue模式,chroot命令之后,用grub-install /dev/hda命令重写MBR,没想到启动时黑屏,我断定GRUB已经写在MBR上,用上下箭头肓人摸象,选择Linux,这时屏幕出现如下提示:
Boot 'Red Hat Linux (2.4.20-8)'
root (hda,2)
Filesystem type is extfs.partition type 0x83
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
Error 15: File not found
Press any key to countinue...
(注:上面的括号显示的是雪点),按Enter键后,出现一画面(如果清晰并加颜色那正是GRUB的启动图形画面),这时什么也看不清,只能看清轮廓,选Linux依然无效,不解!郁闷!我虽知道还有一方法安装GRUB,但没有用过。时间就这样过去了,我猛的想起救世主LILO,rescue模式用lilo -v重写MBR,启动正常,进runlevel 5。一切正常。
问:为什么grub-install /dev/hda没用,我是同方家用电脑呀,又不是什么特别的电脑。我现在只能用lilo 了。
发表于 2004-6-2 15:42:24 | 显示全部楼层

回复: LILO竟然比GRUB强!闷!望高人指点江山。

最初由 qzhou9887 发表
1、今早开电脑,选择WindowsXP没想到还没启动完成,停电。半小时过后,供电恢复,进XP,启动未完成,XP崩溃,重启XP,依然崩溃。用XP安装盘启动想重装一遍,选"L"怕丢失数据,重启。
2、这时重启时MBR已被清除,XP、Linux都进不去,"十分脑火",用红帽安装盘进rescue模式,chroot命令之后,用grub-install /dev/hda命令重写MBR,没想到启动时黑屏,我断定GRUB已经写在MBR上,用上下箭头肓人摸象,选择Linux,这时屏幕出现如下提示:
Boot 'Red Hat Linux (2.4.20-8)'
root (hda,2)
Filesystem type is extfs.partition type 0x83
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
Error 15: File not found
Press any key to countinue...
(注:上面的括号显示的是雪点),按Enter键后,出现一画面(如果清晰并加颜色那正是GRUB的启动图形画面),这时什么也看不清,只能看清轮廓,选Linux依然无效,不解!郁闷!我虽知道还有一方法安装GRUB,但没有用过。时间就这样过去了,我猛的想起救世主LILO,rescue模式用lilo -v重写MBR,启动正常,进runlevel 5。一切正常。
问:为什么grub-install /dev/hda没用,我是同方家用电脑呀,又不是什么特别的电脑。我现在只能用lilo 了。


这个原因可能是grub默认会有一个splashimage的东西,我想如果注销掉它,应该就没有什么问题了。
发表于 2004-6-2 16:20:29 | 显示全部楼层
eMule P2P下载 GPL
发表于 2004-6-2 20:44:41 | 显示全部楼层
不是谁强不强的问题,你的参数可能错了,看看下面这项对不对
root (hda,2)
 楼主| 发表于 2004-6-2 23:16:48 | 显示全部楼层
splashimage没有错,当然注销掉之后,我试了一下,屏幕上没有雪花,能看清菜单(黑白),但就是启动不了,GRUB压根就找不到文件;
root (hda,2)也不会有错的,我还是把grub.conf贴出来吧:
-----------------------------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,2)
#          kernel /vmlinuz-version ro root=/dev/hda4
#          initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,2)/grub/splash.xpm.gz
title Red Hat Linux (2.6.6-lids)
        root (hd0,2)
        kernel /vmlinuz-2.6.6-lids ro root=/dev/hda4
        initrd /initrd-2.6.6-lids.img
title Red Hat Linux (2.4.20-8)
        root (hd0,2)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /initrd-2.4.20-8.img
title DOS
        rootnoverify (hd0,0)
        chainloader +1
-----------------------------------------------------
既然GRUB能显示菜单,应该进入了第二阶段,为什么偏偏找不到文件呢?
发表于 2004-6-2 23:28:14 | 显示全部楼层
手动试试看,看看错误发生在那步?
发表于 2004-6-3 08:08:38 | 显示全部楼层
最好把df -h的结果贴上来。
发表于 2004-6-3 08:53:58 | 显示全部楼层
可能是根目录的位置不对,这里的根目录一定要有vmlinuz,缺省是/boot;
首先用find /grub/grub.conf 来发现 /boot文件系统在哪个盘上。如果是(a,b)
然后修改 root (a,b);
其他不变;
此外最好告诉硬盘是如何分区和各个os的安装的情况;
发表于 2004-6-3 10:38:45 | 显示全部楼层
ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma  ding   DING ni  ma
 楼主| 发表于 2004-6-3 16:50:10 | 显示全部楼层
原因已经查明,不是GRUB的错。谢谢楼上兄弟的提醒,我用fdisk –l命令一看分区信息,觉得得整个硬盘的分区表就像重写一样,分区变了,变得我不认识,但规范了。我做梦也没想到root (hd0,2)会变。
我真不知道该向“比尔”大叔说一声谢谢呢还是骂他一句。都是XP光盘惹的祸,重写MBR的时候,把我的分区表的顺序调了一下。
===============================================
我原来买电脑的时候分了一个主分区[8G],一个扩展分区[32](N个逻辑分区),后来装Linux的时候为了了谨慎期间,从[8G]的主分区劈开了两个区用于Linux,追加到MBR-64字节分区表的“后两个分区”部分,分区信息为:
--------------------------------------------
hda: hda1 hda2 <hda5 hda6 hda7 hda8 hda9 hda10 hda11 hda12> hda3 hda4
分区表第一段(16B):hda1
分区表第二段(16B):hda2
分区表第三段(16B): hda3
分区表第四段(16B): hda4
--------------------------------------------
hda3,hda4正是从那8G劈出来的。但是物理磁道上,它是介于hda1与hda2之间的,当初这样的情况我是有所考虑的,怕有一天会给我带来麻烦,但不幸的是事情还是发生了,一年前的预言变成了活生生的现实。用XP光盘启动过之后,它把分区表信息按物理磁道重写了一遍,hda3,hda4往前挪,变成如下:
-----------------------------------------------------------------
hda: hda1 hda2 hda3 hda4 <hda5 hda6 hda7 hda8 hda9 hda10 hda11 hda12>
分区表第一段(16B):hda1
分区表第二段(16B):hda2(原来的hda3分区信息)
分区表第三段(16B): hda3(原来的hda4分区信息)
分区表第四段(16B): hda4(原来的hda2分区信息)
-----------------------------------------------------------------
至此变区表也变成按物理磁道编排,规范了,但给了我致命一击。我也有所感慨,第一次认识到到LABEL的好处并且学了GRUB的命令环境,/etc/fstab文件第一列它是由LABEL所控,不是定义了哪个具体的分区,以此用LILO启动Linux的时候一切都是正常的。
附上现在的分区信息:#fdisk –l
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       750   6024343+   b  Win95 FAT32
/dev/hda2           751       769    152617+  83  Linux
/dev/hda3           770      1018   2000092+  83  Linux
/dev/hda4          1021      4865  30884962+   f  Win95 Ext'd (LBA)
/dev/hda5          1021      1412   3148708+   b  Win95 FAT32
/dev/hda6          1413      2065   5245191    7  HPFS/NTFS
/dev/hda7          2066      2718   5245191    b  Win95 FAT32
/dev/hda8          2719      3570   6843658+   7  HPFS/NTFS
/dev/hda9          3571      4355   6305481    7  HPFS/NTFS
/dev/hda10         4356      4388    265041   82  Linux swap
/dev/hda11         4389      4413    200781   83  Linux
/dev/hda12         4414      4865   3630658+  83  Linux
#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3             1.9G  460M  1.4G  26% /
/dev/hda2             145M   12M  126M   9% /boot
/dev/hda11            190M   73M  108M  41% /home
none                   62M     0   62M   0% /dev/shm
/dev/hda12            3.5G  2.7G  604M  82% /usr
/dev/hda5             3.0G  578M  2.5G  19% /mnt/winxp

修改grub.conf文件如下:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,2)
#          kernel /vmlinuz-version ro root=/dev/hda4
#          initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.6.6-lids)
        root (hd0,1)
        kernel /vmlinuz-2.6.6-lids ro root=/dev/hda3
        initrd /initrd-2.6.6-lids.img
title Red Hat Linux (2.4.20-8)
        root (hd0,1)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /initrd-2.4.20-8.img
title DOS
        rootnoverify (hd0,0)
        chainloader +1
再次谢谢好心人的帮助!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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