LILO

Besides providing the ability to pass hardware parameters to your kernel at boot time, LILO makes working with a multiple operating system convenient. It's a little cranky about set, and I advise you against tinkering with directly with a text editor unless you're really comfortable with troubleshooting;-) A simple typo can keep you from booting ANY operating system.

You're familiar with the boot sequence in DOS. The first thing that happens after power on is the BIOS takes over, initializing the screen and keyboard and testing the main memory. Until this sequence is completed, the system knows nothing about your devices, operating system, or how you want it configured. After this internal setup, it starts checking your hardware; date and time, CMOS settings (to be able to recognize the first hard disk and it's geometry). Then the operating system starts to load.

To load the operating system, the system loads a 512-byte data segment stored in the first location on the first hard disk (the master). This 512-byte segment contains instructions for the rest of the boot process. The first 446 bytes are reserved for program code; the next 64-bytes contain your partition table; the last 2-bytes are a special "magic number" to verify that these 512-bytes are a valid boot sector. Thus the name Master Boot Record. DOS allows you to boot from the four primary partitions - one of which is marked active, meaning "bootable."

Should something happen to your hard disk, you'll need a bootable floppy for each and every operating system you have installed. (You could very well boot Linux from a floppy, just as you did during the installation - but since floppies run at 360 RPM and your hard disk at 5400 RPM or higher, it will to take longer to boot with a floppy.)

You can also boot Linux from a batch file on your DOS partition including the kernel image using loadlin. This works fine, and comes in handy when you can't seem to get LILO configured properly and don't want to boot from a floppy. You can also pass hardware parameters to the kernel using loadlin, just be aware that the format uses spacing where LILO uses a comma (,) without spaces.

/etc/lilo.conf

You have to include a stanza for each operating system you want to be able to launch through LILO. This is very tedious, and best left to your setup program (or yast or whatever you're using to install the Linux operating system from CD-ROM). However, you need to be able to read the finished file.

# LILO configuration file # generated by 'liloconfig' # # Start LILO global section boot = /dev/hda2 # LILO installation target # this can be a floppy, a partition, or the # whole hard disk (/dev/hda - in which case # LILO would be install in MBR; the default # (if this option is missing) is to install # LILO on the actual root partition #backup=/boot/MBR.hda # backup file for the old MBR (optional) #compact # faster, but won't work on all systems. linear # causes references to sectors to be written as # logical instead of physical addresses which # comes in handy if LILO does not recognize # your hard disk geometry correctly (optional) #message=/boot/greetings # LILO's greeting (optional) prompt # forces sending the LILO prompt; the default # is no prompt #password = q99iwr4 # General LILO password; this may be in a # global or system specific section (optional) timeout=100 # booting by default is no entry is made; # time in thenths of a second - so this is 10 seconds vga = normal # force sane state (80x25 characters); other # valid options are ext (80x50 and ask ramdisk = 0 # paranoia setting # End LILO global section

# Linux bootable partition config begins image = /vmlinuz # Or /zImage depending on which kernel image you're using root = /dev/hda2 # Root partition for kernel read-only # Non-UMSDOS filesystem should be mounted read-only for checking label = linux # Or whatever you want to name it (15 characters max.) # Linux bootable partition config ends

# Second Linux bootable partition config #image = /vmlinuz.old # this is where/how you include a working kernel # if you want to play around with the experimental # kernel and get into kernel hacking big-time # root = /dev/hda3 # read-only # label = linux # End 2nd Linux bootable partition config

# DOS bootable partition config begins other = /dev/hda1 # the 'other' guys label = dos loader = /boot/chain.h table = /dev/hda # DOS bootable partition config ends

Please note that if you change any of the LILO components, modified or had write access (even through file movement) to /etc/lilo.conf, /boot/boot.b, or /boot/map you will have to reinstall LILO by running the Map Installer

/sbin/lilo

Always reboot after installing LILO.

Rebuilt kernel

When you rebuild your kernel there is a target named zlilo in the Makefile which automagically copies /vmlinuz to /vmlinuz.old and the new kernel to /vmlinuz and reinstalls LILO with the command

make zlilo

The catch is that you have to have adjusted /etc/lilo.conf in advance. The new and the old kernel should now be listed.

Removing LILO

Removing a boot manager can be tricky business and should not be attempted unless you know what you're doing - and know how to recover if something goes wrong.

It is a very simple thing to return to a DOS MBR. From the DOS command line enter

fdisk/mbr

This will copy the first 446-bytes into MBR and leave the partitions untouched.

This Website is hosted by :

Back to the main page