linux亦步亦趋(21)linux引导流程二

自举程序grub:

我们知道grub是用来加载内核的,那如何加载及其配置是什么样子的呢。

grub.conf文件:

该文件位于这个目录:即/boot/grub/grub.conf

[root@localhost /]# ls -l /etc/grub.conf
lrwxrwxrwx 1 root root 22 07-31 07:02 /etc/grub.conf -> ../boot/grub/grub.conf
[root@localhost /]# 

查看一下这个文件:

[root@localhost /]# cat /boot/grub/grub.conf
# 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,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-194.el5.img
[root@localhost /]# 

 我们之前对该文件进行了解析,今天再进一步解析:

  • default 定义缺省启动的操作系统,多系统下才有用
  • timeout 菜单的等待时间
  • splashimage 背景图片,其中hd0,0 表示的是第一块硬盘的第一个分区,如果是第二个硬盘的第二个分区则是hd1,1.
  • hiddenmenu 隐藏按钮
  • title 操作系统的标题
  • root 内核所在分区
  • kernel 内核文件
  • initrd 所需镜像

猜你喜欢

转载自xuelianbobo.iteye.com/blog/2098836