解释Grub里的内容...

来源:百度知道 编辑:UC知道 时间:2024/06/05 00:39:41
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,5)
# kernel /vmlinuz-version ro root=/dev/sda8
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
gfxmenu (hd0,5)/message
title RedFlag (2.6.22.6-1)
root (hd0,5)
kernel /vmlinuz-2.6.22.6-1 ro root=LABEL=/ vga=788 splash=silent
initrd /initrd-2.6.22.6-1.img
title Other
rootnoverify (hd0,0)
chainloader +1

里面关键的东西是什么?如果我再装一个ubuntu的话,怎么改?

所有#开头的行都是注释,不用管他:
default=0
表示默认进入第一个title之后的系统(这个计数是从0开始的,title行之后的内容会出现在grub菜单中,例如你的个如不菜单会有两行 RedFlag (2.6.22.6-1);Other ,对吧!语法认为RedFlag (2.6.22.6-1)是第0行而Other是第1行)
timeout=5
表示开机到grub菜单时等待5秒
gfxmenu (hd0,5)/message
这句我也不懂
title RedFlag (2.6.22.6-1)
root (hd0,5)
这句把(hd0,5)设置成根分区并且挂入,以便读取数据,(hd0,5)代表第一块硬盘的第六个分区。(计数方法同样是从0开始!)
kernel /vmlinuz-2.6.22.6-1 ro root=LABEL=/ vga=788 splash=silent
initrd /initrd-2.6.22.6-1.img
以上两句是最重要的,定义了内核以及启动镜像,如果再装ubuntu,你也要写出类似的东西。
root=LABEL=/ vga=788 splash=silent:这是启动时传递给内核的参数,我觉得可以照抄!

title Other
rootnoverify (hd0,0)
chainloader +1
这一小段让你从(hd0,0)中的第一个扇区载入启动信息,你可以不管他,反正选他就进windows。

重装ubuntu的话一概可以自动找到其他系统并且自动重新安装grub的,最多把root=LABEL=/ vga=788 splash=silent这三个参数补到kernel行之后就好了!