Difference between lilo and grub

Difference between lilo and grub

Lilo is a boot strap program and its stands for Linux loader.  lilo knows how to locate kernel and load that kernel. configuration file is /etc/lilo.conf
If you never need to make changes at boot time, then LILO will work just fine for you.

GRUB stands for GRand Unified Bootloader and is a GNU Bootloader that can boot a variety of operating systems from Linux, , DOS, NT 3.51 etc. Its config file is usually in /boot/grub and might be called grub.conf or menu.lst. When you change the config file, you merely reboot to read the changes. The structure of the config file is very different than that of LILO, even though they each convey essentially the same information. When you boot with GRUB, you have a vast array of options available to you. If you ever find that you need to make changes at boot time, usually you will find GRUB more useful.

Difference at a glance :-

* LILO has no interactive command interface, whereas GRUB does.

* LILO does not support booting from a network, whereas GRUB do.
* LILO only loads linux and other boot loaders. and GRUB loads a large number of OS
* LILO works by loading itself into a space that will fit on the MBR. Grub has two stages

example grub config :-

# 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/sda3
#          initrd /initrd-version.img
title CentOS (2.6.18-194.32.1.el5.centos.plus)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.32.1.el5.centos.plus ro root=LABEL=/
initrd /initrd-2.6.18-194.32.1.el5.centos.plus.img

title windows
rootnoverify (hd0,4)

>>> default 0
Default will tell which kernel should load , zero stands for the first one. ( The first menu entry title linux is the one to boot by default.)

>>> timeout 5
After five seconds without any user input, GRUB automatically boots the default entry. To deactivate automatic boot, delete the timeout line. If you set timeout 0, GRUB boots the default entry immediately.

>>> title
Is responsible for booting Linux. The kernel (vmlinuz) is located in the first logical partition (the boot partition) of the first hard disk.  The root partition is specified according to the Linux naming convention (/dev/sda3/), because this information is read by the kernel and has nothing to do with GRUB. The initrd is also located in the first logical partition of the first hard disk.

>>> rootnoverify
rootnoverify command is for OS filesystems not specifically recognized by GRUB, so that GRUB will not try to mount the partition. Next, the chainloader command will use the first sector of the partition of device (hd0,0) and attempt to boot whatever it finds there. This is a common means of booting OSes that install their own boot loaders in the first sector of the partition where they are installed