Linux Step By Steps
    GRUB
GRUB an alternative boot loader to LILO for linux

From Kantione

With a huge amount of asistance from Caldera archives and online documentation. I would assume that anyone else with anything to contribute to this doc would please send the relevant details to me or Mike


LILO has been the defacto boot loader and dual boot loader for linux and other linux multi boot OS's for many years. That is until the recent release of Caldera eDesktop2.4 when at that point GRUB was loaded on install as default, this was the first loader that ignored the 1024 cyl 'killer' zone and would load partitions of any size without fuss. However it fell on users without any warning or apparent documentation and caused quite a stir at the time, and is still not well documented or easily understood. That also applies to LILO even though its been out many years, understanding its complexities can be difficult.

This is an attempt to allieviate the difficulties in handling and installing GRUB.

First GRUB exists as /boot/grub/ also as /etc/grub.conf; the latter is generated by lizard as are the parameters in /boot/grub/menu.lst either of these can be edited.

My GRUB: /boot/grub/menu.lst

The following is a copy of my menu.lst as a way of example with comments: anything that appears between <<xxx>> is a comment for clarification of what you are seeing.

#
# /boot/grub/menu.lst - generated by Lizard
#
<<As it says this is automatically made by Lizard>>

# options
timeout = 5 << this is the timeout for the initial boot screen that comes up when booting>>

# splashscreen = (hd0,1)/boot/message.col24
<<I comment this out as I do not like the gui type splash screens as they tend to hide what's going on at boot time>>

default = 1
title = Linux <<You can leave this unless you have more than one linux bootable>>

root = (hd0,1) <<This declares to the system where / lies more on the numbers later>>

kernel = /boot/vmlinuz-pc97-2.2.14-modular vga=normal hdd=ide-scsi root=/dev/hda3
<< I will come back to this section a bit later>>

# Added by TreLOS for Win4Lin kernel
title = win4lin <<This is the title of the bootable OS could be REDhat>>
root = (hd0,1)
kernel = /boot/win4lin vga=274 debug=2 root=/dev/hda3
<<notice that the first kernel is vga=normal and this one is vga=274 this gives a splash screen>>

If you wanted a Windows partition to be in the boot menu at the start this would be added with:

title = win98 <<or win2000>>
chainloader = (hd0,0)+1

GRUB counts the hard drives differently to LILO, dos and linux:  The first hd is designated hd0 the second hd1 and so on. The partitions on each drive are again numbered from 0 and that is then appended to the hd notation. Assuming that you have a one drive with six (6) partitions then the first partition on that drive is (hd0,0) and the third is (hd0,2).

The /etc/grub.conf file is used only for installing GRUB or parts of GRUB loader into the boot record of any partition selected in the .conffile. Now if you change the file or loose the MBR if its installed there then you need to reinstall GRUB.

Normally /etc/grub.confis not editted, but to reinstall Grub you issue the following command:
grep -v ^# /etc/grub.conf | grub --batch
This reinstalls the boot loader.


/boot/grub/menu.lst: Is the file that you edit to include whatever you wish to have on bootup. Firstly it lists the OS's that you want to be able to boot and select at boottime and creates the menu for this. The syntax is very easy to come to grips with and I will deal with this soon. If you edit this file ts not necessary to reinstall GRUB, as GRUB knows where its located and reads it at each boot.

Details of menu.lst after options:

splashscreen = (hd0,1)/boot/message.col24: Is the pretty GUI style screen that Caldera installs for booting however it hides too many boot messages so I usually hash (#) it out. Its your choice.....

default = 0: Is the Operating system that is selected to boot from in /boot. The bootable OS's are usually listed by you in /boot/grub/menu.lst the first in the list being 0 the second being 1 and so on.

title = linux: You have in here whatever you wish to have as a title so as you know at boottime, if you have multiple selections which to choose. I will have say title = linux-2.2.14 and the next one is title = linux-2.4.0 and maybe title = win2000 etc.

root =: This is where the partition/ lies on the harddrive. In the first case as above its on hd0 and its the second partition hence (hd0,1) just as default also sees it as 1, swap being the first and 0.

kernel =: We all should know that this refers to the kernel to be booted. /boot/xxxxxxx is where the kernel image lies and also refers to which kernel to boot, if you have more than one linux kernel compiled.

vga=xxxx: Refers to the vga screen that is presented, '274' is a splash type and 'normal' is the B&W command line style: refer to man. All parameters that you wish to be used at kernel load time are like LILO written in here the last being root=/dev/hdxx and all on one line. There is no need to use quotes "" around the parameters as is necessary in LILO.

GRUB natively boots all linux and unix derivatives but any of the other OS's such as OS2, NT etc need to be chainloaded as per the example above.

With a single HD GRUB can be installed on the 1st partition of that HD however if you have a second hardrive that you wish to boot from Grub must be set to the MBR.

Lets say that you cannot get GRUB to reboot at all and you need to edit the/boot/grub/menu.lst or even reinstall GRUB and you have no way to get into the system; there is one easy way to do this.  Assuming that you have an install boot floppy for Caldera of any version, put this in the floppy drive. Boot with the floppy to the introduction Caldera screen and at the prompt BOOT: type in the following:

vmlinuz root=/dev/hdx

(where x is the drive / resides on) you can also enter 5 or 3 here to boot into kde or command line.

I trust that this may be of help to the floundering souls as GRUB is very easy to manage.