700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > linux编译lilo linux中LILO及GRUB配置实例

linux编译lilo linux中LILO及GRUB配置实例

时间:2020-06-22 04:34:30

相关推荐

linux编译lilo linux中LILO及GRUB配置实例

1.配置LILO是通过编辑/etc/lilo.conf(也可能是/etc/lilo.conf.anaconda文件)

使用cat命令打开如下:

[root@localhost etc]# cat lilo.conf.anaconda

prompt

timeout=50

default=linux

boot=/dev/hda

map=/boot/map

install=/boot/boot.b

message=/boot/message

linear

image=/boot/vmlinuz-2.4.20-8

label=linux

initrd=/boot/initrd-2.4.20-8.img

read-only

append="root=LABEL=/"

other=/dev/hda1

optional

label=DOS

解释如下:

prompt

timeout=50

default=linux

这三行表示系统启动时将会显示一个lilo提示信息,并等待5秒钟,注意timeout的单位是0.1秒。如果5秒钟之内没有输入系统名字那么将使用默认引导deafault=limux,引导标号为linux的系统。

boot=/dev/hda

这表示启动盘是第一张ide硬盘(由于这个原因,通常不能从软盘来启动linux)

install=/boot/boot.b

表示要将/boot/boot.b文件内容写到引导记录中。该文件在安装linux时已经创建。

接下来定义的是各个引导项目。image=/boot/vmlinuz-2.4.20-8这行定义了启动时使用的内核映像,label=linux定义了这个启动选择项名称是linux。首先是linux,然后是dos(windows),笔者机器上正是安装了linux和windows xp两个系统。

当完成了上述配置工作后,为了使它的设置生效,需要执行/sbin/lilo命令。

2.配置GRUB是通过编辑/boot/grub/grub.conf文件实现的,实例如下

[root@localhost grub]# cat 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,1) # kernel /vmlinuz-version ro root=/dev/hda3 # initrd /initrd-version.img #boot=/dev/hda default=0 timeout=10 splashimage=(hd0,1)/grub/splash.xpm.gz title Red Hat Linux (2.4.20-8) root (hd0,1) kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ initrd /initrd-2.4.20-8.img title DOS rootnoverify (hd0,0) chainloader +1 [root@localhost grub]#

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。