在Linux中常用的启动引导工具:grub和lilo

在Linux和WINDOWS两系统并存时就需要安装GRUB(Grand Unified Bootloader),GRUB被广泛地用于替代lilo,GRUB支持在启动时使用命令行模式,支持md5加密保护 还可以从ext2/ext3、ReiseFS、JFS、FAT、minix及FFS文件系统上启动其配置文件为/boot/grub/grub.conf,更改grub.conf即可立时生效如果硬盘上的MBR被更动过,可以用/sbin/grub-install /dev/hda来重安装grub现在我们打开/boot/grub/grub.conf查看一下

# vim /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/sda2

#          initrd /initrd-version.img

#boot=/dev/sda

default=0   

#default=0表示默认启动第一个系统,如果系统有两个系统是用什么做为分隔符的呢?title就是系统的分隔符,第一个title后面就是第一个系统,用0表示。

timeout=5

#timout=5,就是默认在启动选择界面停留的时间,单位是秒。等待5秒自动进入默认操作系统

splashimage=(hd0,0)/grub/splash.xpm.gz

#splashimage是grub启动背景画面,如果是自己写grub.conf文件,这个可以不用写。

hiddenmenu

title Red Hat Enterprise Linux Server (2.6.18-53.el5)

#title后面就是系统在启动时候显示的名字

        root (hd0,0)

#root 启动文件所在位置

        kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ rhgb quiet

#kernel 内核所在位置和名字

        initrd /initrd-2.6.18-53.el5.img

#initrd内核镜象的名字

grub.conf的范例:

timeout=10      #等待10秒自动进入默认操作系统

splashimage=(hd0,0)/grub/splash.xpm.gz #grub启动背景画面

default=0       #默认进入第一个标题

title Red Hat Linux (2.4.20-18)   #Red Hat Linux标题

root (hd0,0)      #根文件系统位置

kernel  /vmlinuz-2.4.20-18 ro root=LABEL=/ #核心位置与核心加载参数

initrd  /initrd-2.4.20-18.img   #启动initrd ram盘 

title windows      #另一个操作系统的标题

rootnoverify (hd0,1)    #操作系统存放在hd0,1上,不要在grub里mount

chainloader +1     #从hd0,1的第一个扇面启动

原文地址:https://www.cnblogs.com/fanweisheng/p/11108943.html