QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 840|回复: 4

关于grub (redhat9+winxp,100%原创)

[复制链接]
发表于 2004-6-13 20:18:34 | 显示全部楼层 |阅读模式
关于grub的修改问题
原因:重新装windows系统导致MBR别重写,无法进入linux。(我的系统时redhat9+winxp)
解救的方法:

1.用linux光盘第一张,光驱引导进入。
2.linux rescue  ,再回车。
3.一路continue下去。

4.到来好象有sh# 输入: chroot /mnt/sysimage
5.接着sh# 输入:  grub,进入grub的环境


6.root (hd0,                                     !!!有注意的是root 后面有个空格,很重要哦 !!!
      
      (按Tab看你的linux装在哪里,这个是我的:
   grub> root (hd0,
Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0xb
   Partition num: 4,  Filesystem type is fat, partition type 0xb
   Partition num: 5,  Filesystem type is fat, partition type 0xb
   Partition num: 6,  Filesystem type is fat, partition type 0xb
   Partition num: 7,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 8,  Filesystem type unknown, partition type 0x82
   Partition num: 9,  Filesystem type is fat, partition type 0xb
                                                                                
grub> root (hd0,


  这说明我的linux在(hd0,7)
   hd0中的0代表第一个硬盘,普通人都是只有一个硬盘.
   如果有两个硬盘的例外,如果你的linux放在第二个硬盘的话 ,要用hd1
上一步即是  root (hd0,7)   相对我的电脑

7.cat  (hd0,7)/boot/grub/grub.conf    (作用是看看你的grub的一些配置)


grub> cat (hd0,7)/boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,9)
#          kernel /boot/vmlinuz-version ro root=/dev/hda10
#          initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=8
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
title Red Hat Linux  # (2.4.20-
        root (hd0,7)
        kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/   #这里阿!!!!!!!!!!!!!!!!!!!!
        initrd /boot/initrd-2.4.20-8.img                !!!!!!!!!!!!!!!!!!!!!!!!!
title WINXP
        rootnoverify (hd0,0)
        chainloader +1
                                                                                
grub>


8.kernel (hd0,7)/boot/vmlinuz-2.4.20-8 ro root=/dev/hda8   (如果忘记了,可以看上面的阿。)
9.initrd (hd0,7)/boot/initrd-2.4.20-8.img
10.setup (hd0)
11.boot
12.接着会跳出去,sh#  输入exit  再回车。(好象要两次)


说明:有个特殊的情况:当你重装windows时,一些原来hda即分区的顺序会改变了,
      这时当你重启的时候,要按着上,下两个键来回换(在小键盘)
      然后按到上面,在回车,它会提示你分区已经改变了
      然后按  e  ,修改。
    例如:   原来的时root(hd0,9)   将它改成现在的root(hd0,7)
        然后按  b  ,重启。
发表于 2004-6-14 08:38:53 | 显示全部楼层
真不错!
回复

使用道具 举报

发表于 2004-6-14 13:22:36 | 显示全部楼层
说明:有个特殊的情况:当你重装windows时,一些原来hda即分区的顺序会改变了,
这时当你重启的时候,要按着上,下两个键来回换(在小键盘)
然后按到上面,在回车,它会提示你分区已经改变了
然后按 e ,修改。
例如: 原来的时root(hd0,9) 将它改成现在的root(hd0,7)
然后按 b ,重启。

碰到这种情况还要修改fstab文件。
回复

使用道具 举报

 楼主| 发表于 2004-6-14 16:03:26 | 显示全部楼层
谢谢大家的支持
回复

使用道具 举报

发表于 2004-6-15 17:50:06 | 显示全部楼层

Re: 关于grub (redhat9+winxp,100%

前面和后面都是和我一样的.  

[quote:763375d0a7="m1011184"]
5.接着sh# 输入:  grub,进入grub的环境


6.root (hd0,                                     !!!有注意的是root 后面有个空格,很重要哦 !!!
      
      (按Tab看你的linux装在哪里,这个是我的:
   grub> root (hd0,
Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0xb
   Partition num: 4,  Filesystem type is fat, partition type 0xb
   Partition num: 5,  Filesystem type is fat, partition type 0xb
   Partition num: 6,  Filesystem type is fat, partition type 0xb
   Partition num: 7,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 8,  Filesystem type unknown, partition type 0x82
   Partition num: 9,  Filesystem type is fat, partition type 0xb
                                                                                
grub> root (hd0,


  这说明我的linux在(hd0,7)
   hd0中的0代表第一个硬盘,普通人都是只有一个硬盘.
   如果有两个硬盘的例外,如果你的linux放在第二个硬盘的话 ,要用hd1
上一步即是  root (hd0,7)   相对我的电脑

7.cat  (hd0,7)/boot/grub/grub.conf    (作用是看看你的grub的一些配置)

[/quote]


这段话所叙述的方法我看可以这么改吧,我刚经历过,我用的AS3,方法是这样的:

直接 #su
进入SHELL     
     [...]# cd /boot/grub
     [...]# emacx  grub.conf

接下来的就一样烙..         
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-9-28 21:26 , Processed in 0.055946 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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