Pick a Free OS

User login

Navigation

An in-depth look at LILO

Let's look at a few boot combinations. When booting from a floppy disk, the very first sector of the disk is loaded by the BIOS into memory. This particular area of the floppy disk on bootable floppies is supposed to contain a program that will boot the respective operating system. Similar to this procedure of booting a floppy disk, let's assume that LILO has been written on the MBR (Master boot Record) of the hard disk of a dual boot system. During the booting operation the MBR is loaded into memory, which then executes it's respective operating functions and provides the user with a choice of booting into any operating system of their choice. To get the figures right, the first 446 Bytes of MBR are made use of by the Boot Loader and the rest 64 Bytes of the data are related to information about the partition table.

Making a backup copy of your MBR on a floppy disk

This is just a precaution. LILO is quite safe to use so you probably won't need this tip.

The command for the backup is as following.

bash# dd if=/dev/hda of=/dev/fd0 bs=512 count=1

"dd" is the command used to write raw data onto any storage media. This particular command tells 'dd' to copy the first 512 Bytes of information from the hard drive /dev/hda (MBR) to the floppy disk (/dev/fd0).

Restoring the old MBR is just about turning the parameters around. The command is as follows.

bash# dd if=/dev/fd0 of=/dev/hda bs=446 count=1

Getting rid of LILO

For DOS users, restoring your MBR and getting rid of LILO is just one simple command.

c:> fdisk /mbr

Getting back LILO

What happens quite often is that LILO might get wiped out of the MBR. Re-installing Windows is one of the most common reasons for this. Whatever the reason, you should know how to recover and re-install LILO.

Get a hold of a installation CD. Just about every Linux distribution these days is available on bootable CD's. We've had terrible times searching for a working clean floppy for a boot disk and we don't recommend boot disks.

If you do have good disks then use the images on your distribution CD. SuSE provides a image of a rescue disk on their CD. Most distributions provide such images. A good place to look for boot images is www.bootdisk.com. Download one, follow the instructions and you'll soon have a working boot disk.

Under Linux, use "dd if=/cdrom/disks/rescue of=/dev/fd0" to create a rescue floppy disk. Under DOS use rawrite.exe (included in most distributions) and then do "rawrite image-name a:".