LinuxSir.cn,穿越时空的Linuxsir!

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

丢失引导分区,怎么使用Grub重新引导系统?谢谢

[复制链接]
发表于 2005-12-10 10:34:33 | 显示全部楼层 |阅读模式
我有两个硬盘,主盘上是linux rh9.0,从盘上winXP

昨天晚上在WINXP下往LINUX RH9.0里头写了个文件,重新启动后就只有
grub>

使用以下的命令
root (h    敲<tab>
possible disks are:hd0,hd1

root (hd0,    敲<tab>
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7  
Partition num: 4, Filesystem type unknown, partition type 0x7

root (hd0, 0)
filesystem type unknown,partition type 0x7

root (hd0, 4)
filesystem type unknown,partition type 0x7


怎么两个分区都是不可知的啊???
这样我怎么引导呢???
请问还有没有其他好点的办法???
发表于 2005-12-10 10:51:42 | 显示全部楼层
不要在win下写linux分区,这是个教训!

你不记得linux的/boot分区在哪里吗?那winxp呢?
都不记得那就只好一个个试验喽~

比如双硬盘启动winxp,假定winxp装在从盘第一个分区(hd1,0)
  1. grub>root (hd1,0)
  2. grub>makeactive
  3. grub>map (hd0) (hd1)
  4. grub>map (hd1) (hd0)
  5. grub>chainloader (hd1,0)+1
  6. grub>boot
复制代码

再比如双硬盘启动linux,假定linux的/boot装在(hd0,0),内核映像在/boot/vmlinuz,根分区/在 hda5:
  1. grub>root (hd0,0)
  2. grub>kernel /vmlinuz root=/dev/hda5
  3. grub>boot
复制代码

一般能引导成功。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-10 11:12:16 | 显示全部楼层
多谢,教训我记住

root (hd0, 敲<tab>
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type unknown, partition type 0x7

root (hd1, 敲<tab>
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x83
Partition num: 2, Filesystem type unknown, partition type 0x82

这四个分区我都试过了,都提示:
filesystem type unknown ,partition type 0x**

这是我从别的论坛找来的
Partition num: 0, Filesystem type is fat, partition type 0x6  
Partition num: 2, Filesystem type is ext2fs, partition type 0x83  
Partition num: 4, Filesystem type unknown, partition type 0x7  
Partition num: 5, Filesystem type is ext2fs, partition type 0x83  

根本就没有fat或者ext2这种分区
真不知道该怎么弄了!!
回复 支持 反对

使用道具 举报

发表于 2005-12-10 11:38:51 | 显示全部楼层
为什么一定要fat ext2分区?
我的2000是ntfs,linux是reiserfs,照样引导
回复 支持 反对

使用道具 举报

发表于 2005-12-10 11:46:40 | 显示全部楼层
从你的情况来看应该是写入导致Filesystem type unknown,所以grub来在启动过程中找不到stage1 stage2文件来载入所以出现grub shell。不知道怎么弄,汗...也许得重装或者看看有没有朋友成功修复过
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-10 11:48:22 | 显示全部楼层
我不是那个意思,我的意思是说分区都是不可知的
我敲哪一个,都提示:
filesystem type unknown ,partition type 0x**
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-10 11:52:14 | 显示全部楼层
Post by dato
从你的情况来看应该是写入导致Filesystem type unknown,所以grub来在启动过程中找不到stage1 stage2文件来载入所以出现grub shell。不知道怎么弄,汗...也许得重装或者看看有没有朋友成功修复过

好象有点道理,,具体有没有,我也不知道
呵呵,,,都看了好几个论坛的不下20个帖子了,还是没办法
哎~~~~~~~~~~~`
这下我可糗大了.
回复 支持 反对

使用道具 举报

发表于 2005-12-10 12:16:03 | 显示全部楼层
重装grub。
运行grub-install,再运行grub --no-floppy进行设置。
回复 支持 反对

使用道具 举报

发表于 2005-12-10 15:34:30 | 显示全部楼层
用livecd重装grub
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-11 11:37:14 | 显示全部楼层
我把第一张盘拿出来启动
进入shell后
输入chroot (空格)/mnt/sysimage
提示cannot change root directory to /mnt/sysimage: no such file or directory
没有管它,继续输入grub-install(空格)/dev/hda
提示command not found

而且在先前,好像会自动的帮我检测
检测结果是:没有找到任何linux分区
我晕???????我该怎么办???难道真的要重装吗???
回复 支持 反对

使用道具 举报

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

本版积分规则

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