LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: andrew

重装win后grub丢失,没有安装光盘,求助!

[复制链接]
发表于 2004-11-14 20:59:40 | 显示全部楼层
最初由 andrew 发表
我用grub.exe进入到“grub>”提示符下敲入find /boot/vmlinuz
提示找不到文件,现在怎么办?


Then what files are stored in /boot?
 楼主| 发表于 2004-11-14 21:06:49 | 显示全部楼层
i don't know!
发表于 2004-11-14 21:18:14 | 显示全部楼层
最初由 andrew 发表
我用grub.exe进入到“grub>”提示符下敲入find /boot/vmlinuz
提示找不到文件,现在怎么办?


啊,有windows下的grub,前面忘记了。
不能用find /boot/vmlinuz,因为grub并不知道/boot在那个分区下,你需要用Tab键的补齐功能来寻找。
grub>find (hd接下来用Tab补齐功能,看看屏幕上的提示,比如:

  1. grub> find (hd
  2. Possible disks are:  hd0 hd1
  3.                                                                                                                               
  4. grub> find (hd0,
  5. Possible partitions are:
  6.    Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
  7.    Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
  8.    Partition num: 2,  Filesystem type unknown, partition type 0x82
  9.    Partition num: 4,  Filesystem type is ext2fs, partition type 0x83
  10.    Partition num: 5,  Filesystem type is ext2fs, partition type 0x83
  11.    Partition num: 6,  Filesystem type is ext2fs, partition type 0x83
  12.    Partition num: 7,  Filesystem type is ext2fs, partition type 0x83
  13.    Partition num: 8,  Filesystem type is ext2fs, partition type 0x83
  14.    Partition num: 9,  Filesystem type is ext2fs, partition type 0x83
  15.    Partition num: 10,  Filesystem type is ext2fs, partition type 0x83
  16.    Partition num: 11,  Filesystem type is ext2fs, partition type 0x83
  17.    Partition num: 12,  Filesystem type is ext2fs, partition type 0x83
  18.    Partition num: 13,  Filesystem type is ext2fs, partition type 0x83
  19.    Partition num: 14,  Filesystem type is ext2fs, partition type 0x83

  20. grub> find (hd0,0)/
  21. Possible files are: lost+found grub message.ja message kernel.h System.map ini
  22. trd-2.4.21-15.EL.img System.map-2.4.21-15.EL config-2.4.21-15.EL vmlinux-2.4.21
  23. -15.EL vmlinuz-2.4.21-15.EL
  24.                                                                                                                               
  25. grub> find (hd0,0)/vmlinu
  26. Possible files are: vmlinux-2.4.21-15.EL vmlinuz-2.4.21-15.EL
  27.                                                                                                                               
  28. grub> find (hd0,0)/vmlinuz-2.4.21-15.EL
复制代码

这里的(hd0,0)就是/boot分区在grub中的标识。以上仅供参考。
发表于 2004-11-14 21:25:03 | 显示全部楼层
最初由 lin_lin13 发表
在autoboot的内容:
loadlin vmlinuz initrd=initrd.img ramdisk_size=9216

我在想,有没有个参数是直接进入“恢复模式”??正在寻找中。。。

朋友们可以提供一些loadin的使用方法。


最初由 lin_lin13 发表
在autoboot的内容:
loadlin vmlinuz initrd=initrd.img ramdisk_size=9216

我在想,有没有个参数是直接进入“恢复模式”??正在寻找中。。。

朋友们可以提供一些loadin的使用方法。


Bare in mind, always keep a LiveCD on hand so that you can rescue your downed system.

There are numerous LiveCD available on the net.  The most common one should be KNOPPIX.  However, if you want to revive your system, another one called SystemRescueCD from http://www.sysresccd.org/ is much better.

loadlin is a DOS program to let u boot up your Linux kernel image and then start up your system.  Format as below:

loadlin.exe [kernel-image] [options]

Now, if you don't have a LiveCD, you must find/download some tools to allow you read the Linux ext2 or ext3 partition.  Assume your Linux system resides in /dev/hda5, then look for the /boot directory in hda5 and look for your kernel image,  usually called vmlinuz-2.6.x.  Depends on distro, this file is approx 1-3MB.   Copy it to the same directory as loadlin.exe

Next, look for initrd image, in /boot at well, the file called something like initrd-2.6.8x.  Again, copy it to the same dir as loadlin.exe

Then, restart your system is pure DOS mode.   cd to your loadlin dir.  Note down the name of the kernel image and initrd (because DOS does not support long filename).  They may appear as vmlinu~1 or initrd~1, something like that.

Now, issue the following command:

loadlin.exe vmlinu~1 initrd=initrd~1 ramdisk_size=9216 root=/dev/hda5 ro

Once your system start up, setup GRUB again.

Hope you can follow.

Oh, is your XP installed in a NTFS partition?  If yes, unless you have a rescue CD, otherwise you are hopeless!  loadlin.exe only works in pure DOS!

Good luck!
 楼主| 发表于 2004-11-15 09:05:34 | 显示全部楼层
7dehao兄,我用tab补齐时,根本就没有显示linux那个分区,全部都是win的分区,现在怎么做啊?
发表于 2004-11-15 19:11:02 | 显示全部楼层
我找到恢复的方法了,正在整理中,希望版主加精!

有需要的可以跟贴!!!
发表于 2004-11-17 11:35:29 | 显示全部楼层
解决的思路:

找到原来系统中的内核比如:vmlinuz 和initrd.img 文件,然后在dos下运行:
loadlin vmlinuz initrd=initrd.img root=/dev/hda7 即可!

进入系统后,问题就解决了!

如果有朋友想知道如何找到原来的内核文件,可以告诉我一声,我可以继续发帖!没必要的话我就省事了!
发表于 2004-11-17 12:34:10 | 显示全部楼层
请楼主说明一下好吗?
发表于 2004-11-17 12:49:02 | 显示全部楼层
In addition to read the kernel image from HDD, I think these files may be extracted from the ISO with tools like ISO Buster, CD Mage etc.
发表于 2004-11-17 14:34:49 | 显示全部楼层
具体解决办法:
开始与用ISO安装的方法一样,我也简单说一下,
1、解开fc2中的第一张光盘中的vmlinuz和initrd.img,并下载一个loadlin.exe
redhat9.0中应该有,不过在fc2中我没有找到。
2、在dos提示符下输入:
  loadlin vmlinuz initrd=initrd.img ramdisk_size=9216
3、回车后进入fc2的安装模式,选择硬盘安装,选择ISO存放的路径。

4、这时不用管别的了,按下Alt+F2,此时进入一个bash的环境。
5、#cd /tmp    进入临时文件夹,这个文件夹可以读写。
6、如果不清楚内核存放在那个分区,可以用#fdisk -l 查看一下我的在/dev/hda7
7、#mknod hda7 b 3 7
   加载块设备如果是/dev/hda5 ,变为#mknod hda5 b 3 5
8、mkdir sysroot
9、#mount hda7 sysroot
  进入sysroot目录,我们就会看到fc2的内核文件比如:vmlinuz 和initrd.img

好了,我们的工作完成了一半了,我们还要把这两个文件拷贝到软盘中。

Let's go! 继续。。。


10、回到/tmp目录。
11、#mkdir floppy
12、#mknod /dev/fd0 b 2 0
13、#mount /dev/fd0 floppy
14、进入sysroot目录下,执行#cp vmlinuz ../floppy
                          #cp initrd.img ../floppy

好了,这两个文件复制到了软盘上。


接下来,重新启动机器,进入dos系统,将软盘中的这两个文件拷贝到某个目录下如: d:/

15、执行命令:
loadlin vmlinuz initrd=initrd.img root=/dev/hda11 ramdisk_size=9216

root=为linux系统的根分区所在的分区。
这时系统进入了FC2,

好了,进去后就不用我说了吧,想干什么就干什么!

恢复grub,不会!自己搜一下!


好了!多提意见!


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

本版积分规则

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