By saikee at 2005-12-01 16:37
In booting an operating system can be booted directly by naming its kernel (always called vmlinuz with possible a long tail attached) and the ram disk file initrd.
The alternative is to boot the system indirectly. This involves asking the boot loader of system A to boot the boot loader of system B and let the system B booted by it boot loader. The technique is known as "chainloading".
Linux always boots a DOS or Windows by chain loading as they haven't got a formal kernel. However the same technique can be used to boot fellow Linux.
Advantage of chainloading
You can boot any DOS, Windows, Linux, BSD and Solaris with the same commands comprising just 3 lines in Grub's /boot/grub/menu.lst, using an example that it is in a partition hda7 (or 7th partition of first disk and remember Grub counts from 0)
similarly in Lilo only 2 lines needed in its /etc/lilo.conf
title Linux @ hda7
Any operating system becomes "chainloadable" if it has a boot loader inside its root partition. To put a boot loader inside its partition in Linux you type
for Lilo and
for Grub where hda7 is the root partition of the Linux(replace 7 with a number to suit your case)
For any system just quote the relevant partition number in the chainloading commands.
[b]Chainloading for non-Linux systems[/]
Life has been made easier with all Microsoft systems, all versions of Dos and Windows, because each of them has to be installed in an active primary partition and so hence will always has a boot loader in the root partition.
BSD and Solaris also need to be installed in primary partitions. Their boot loaders can either be instructed to take over the MBR or inside the root partition. It seems to be a characteristic of these systems that the boot loader will automatically placed inside the root partition if access to the MBR is denied.
To boot any of them just put in the correct partition reference for the "root" statement for Grub or "other=" statement for Lilo
[b]Maximum number of systems handled by the boot loaders[/]
(1) NTldr of Win2k or XP = 10 systems including self
(2) Lilo = 15 systems
(3) Grub = unlimited
The above is of academic interest only as boot loaders can do relays with one boot loader passing control to another and hence the number of systems bootable is unlimited..
(1) The "label" of Lilo is same as "title" for Grub. Both are for description of the system except Lilo uses a fixed field limiting the number of characters. Grub permits any characters in title statement.
(2) The Lilo's "other= " is the same as Grub's "root" combining with "chainloader +1". Indeed one can use
to save typing one extra line.
(3) Lilo use a static screen and permit a maximum of 15 booting entries. Grub does not seem to have a limit. My longest /boot/grub/menu.lst has over 100 entries as I use 4x 200Gb disks with a total of over 120 partitions.
(4) The limit of maximum partition number for a Sata or SCSI disk is 15. For IDE disk 63 is the maximum partition number.
(5) Lilo checks every line in lilo.conf and makes sure every system can be booted before implementing any change in lilo.conf. Grub doesn't. Therefore if you pre-partition the hard disk say into 50 partitions you can build a menu.lst with entries booting every empty partition "before" you even install a Linux in it!!!!! The Linux is of course bootable the moment its installation is completed. That is how my menu.lst looks like
title empty @ hdc39
title empty @ hdc40
title empty @ hdc41
..............and so on