LinuxSir.cn,穿越时空的Linuxsir!

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

如何判断我的机器是用grub还是lilo引导的?

[复制链接]
发表于 2003-7-20 12:13:47 | 显示全部楼层 |阅读模式
是不是要读取MBR中的数据?如何鉴别?
发表于 2003-7-21 09:32:52 | 显示全部楼层
我没使用过lilo

看界面吧
发表于 2003-7-21 10:03:48 | 显示全部楼层

一启动就知道啦

你如果是用GRUB那启动画面上面有一个GRUB的版本号啊!
 楼主| 发表于 2003-7-21 18:12:35 | 显示全部楼层
可能是我没有说清楚,我想做的就是在一个已经进入系统的机器中,检测该机器是用的lilo还是grub,要完全靠数据来说明问题,不是看界面。
发表于 2003-8-6 04:22:53 | 显示全部楼层
hehe, xdw_jack, u ask this in both places. so u must really want to know the answer.

see grub doc.
Embedded variables in GRUB

Stage 1 and Stage 2 have embedded variables whose locations are well-defined, so that the installation can patch the binary file directly without recompilation of the stages.

In Stage 1, these are defined:

0x3E
    The version number (not GRUB's, but the installation mechanism's).
0x40
    The boot drive. If it is 0xFF, use a drive passed by BIOS.
0x41
    The flag for if forcing LBA.
0x42
    The starting address of Stage 2.
0x44
    The first sector of Stage 2.
0x48
    The starting segment of Stage 2.
0x1FE
    The signature (0xAA55).


so do dd if=/dev/hda of=cc bs=512 count=1 and check the cc using hexedit. i use grub and the 0x1fe of cc (my hda) is aa55.

so...
发表于 2003-8-6 04:24:00 | 显示全部楼层
forget to say that u can try different systems and see if this is true. and pls report u results on linuxbbs as well.
 楼主| 发表于 2003-8-6 21:52:32 | 显示全部楼层
我没有完全明白你的意思,aa55说明这个扇区是一个引导扇区而不是一个普通的扇区,而且上面的参数好像都不能从根本上来区分是什么来引导的,我现在用的方法是如下:

dd if=/dev/hda of=cc bs=512 count=1

然后检查cc里面是否有GRUB这个单词,如果有,说明是grub,如果没有,说明用的是lilo,当然这个是建立在只有这两种情况下。我用这种方法到目前位置还没有发现反例。
发表于 2003-8-7 02:27:35 | 显示全部楼层
i think u method is also ok. although not a general rule. have to check the grub code and lilo code in order to know what content they really write.
发表于 2003-8-23 17:17:01 | 显示全部楼层
不知道有什么区别???我是新人,在些提问!!
发表于 2003-8-29 10:49:58 | 显示全部楼层
he/she want to check which boot loader system uses, and then do some modification to system conf file, right?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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