LinuxSir.cn,穿越时空的Linuxsir!

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

TS grub.conf missing: reboot directly from grub command console?

[复制链接]
发表于 2005-10-5 11:22:40 | 显示全部楼层 |阅读模式
I am testing the troubleshooting of missing grub.conf. I know exactly how to solve it by creating grub.conf manully in rescue mode.

My question is can I do it another way without entering the rescue mode?  

Here is what I tried:

When the grub command console shows up, type several GRUB commands to test

root (hd0,0)
kernel /vmlinuz-XXXXX-img ro root=LABEL=/
initrd /initrd-XXXXX.img

All the commands work fine. Then can I just type "boot" to reboot the machine, and after machine is booted up, create the grub.conf in the normal mode?

I tested this way, but it doesn't work....I still receive "kernel panic" error.

I also tried to pass an init=/bin/sh option or single option to the kernel on the command console, same error.

Does it mean that you have to enter rescue mode and manually create grub.conf before it can boot correctly?  
Does it mean that the command console is just for you to test your configuration without really passing those value to the boot process?

Maybe a very silly question , but I am really curious....
发表于 2005-10-6 07:13:50 | 显示全部楼层
Is the root path which u put correct??
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-10-6 12:01:44 | 显示全部楼层
Yes, the root path is correct, otherwise the kernel and initrd command won't pass.
回复 支持 反对

使用道具 举报

发表于 2005-10-6 21:05:01 | 显示全部楼层
i copyed my grub to /root for backup
then rm -if /boot/grub/grub.conf
reboot the system
get a grub console

do as you did

enter the system

then create grub.conf and add four line as follow

/boot/grub/grub.conf

title RHEL AS4
        root (hd0,0)
        kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/
        initrd /initrd-2.6.9-5.EL.img


reboot the system

all booting is OK  

Do not need to enter in rescue mode

when the grub is missing (not grub.conf) the only way to solve the problem is rescue
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-10-7 04:48:16 | 显示全部楼层
Thank u for the response. I tested it again today and it works finea: I don't need to enter rescue mode.

You also wrote:
"when the grub is missing (not grub.conf) the only way to solve the problem is rescue".


What do you mean by "when the grub is missing"?   How could I create this troubleshooting situation?  I know the "grub-install" command.
回复 支持 反对

使用道具 举报

发表于 2005-10-7 12:08:38 | 显示全部楼层
Post by zaiwen
Thank u for the response. I tested it again today and it works finea: I don't need to enter rescue mode.

You also wrote:
"when the grub is missing (not grub.conf) the only way to solve the problem is rescue".


What do you mean by "when the grub is missing"?   How could I create this troubleshooting situation?  I know the "grub-install" command.

He probably means if grub binary is also missing, so that you can even go to the grub mode.
回复 支持 反对

使用道具 举报

发表于 2005-10-7 17:41:00 | 显示全部楼层
it's easy to do that
such like:
dd if=/dev/zero of=/dev/hda bs=446 count=1
then reboot
回复 支持 反对

使用道具 举报

发表于 2005-10-7 23:32:02 | 显示全部楼层
Post by cxfcxf
it's easy to do that
such like:
dd if=/dev/zero of=/dev/hda bs=446 count=1
then reboot

that's MBR broken, not grub.
回复 支持 反对

使用道具 举报

发表于 2005-10-8 11:04:35 | 显示全部楼层
i mean grub in mbr
回复 支持 反对

使用道具 举报

发表于 2005-10-8 13:09:36 | 显示全部楼层
Post by cxfcxf
i mean grub in mbr

Well, actually grub is not in MBR. Grub can load stage1 and stage1.5 to MBR but not itself. MBR just contains boot loader + Partition Table.
回复 支持 反对

使用道具 举报

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

本版积分规则

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