Mr. Curious: General FAQ

"How Do It Know?" How can a lowly bootstrap find my devices and files? After all, I've got this full blown Linux system and I had to work just to get the partitions mounted and files located properly. So how can LILO find these files without so much as a running kernel?

This is one of LILO's better tricks. (It also is responsible for some of the confusion.) LILO doesn't work until you install it. The installation process looks up the location of each file. Since the installation (/sbin/lilo) is done while Linux is up and running, all of the location information is available. The "answers" are then stored in the map file for use by LILO when it boots. (And yes, the map file's location, in turn, must be written into the boot loader itself.)

I changed my message file.  Why doesn't LILO see the changes?

You must run /sbin/lilo in order to make the changes take effect. /sbin/lilo is a boot installer. The files called for in lilo.conf have to be located by /sbin/lilo and "installed" into your system boot. If you edit your message file, the new message file is saved somewhere else on your disk. Without installing the new file references, LILO will keep showing you the old file, even though it's been deleted. Sometime later that "deleted" space will be reused and your message will turn to junk. This is important; think of what would happen if it were the kernel or one of the other executable files.

I just tried adding a command "xxx=yyy" and it had no effect!  Doesn't LILO support that?

It probably does.  You likely just forgot to run /sbin/lilo to register the changes. See the preceeding question.

How can I fix LILO without repeating the whole install?

You can repeat the steps that the install should have done for you. Namely, set up a lilo.conf file (or find the current one and inspect and maybe fix it), make sure the necessary files are present, and run /sbin/lilo. This procedure is covered elsewhere.

How do I uninstall LILO?

Under the right circumstances you can simply type lilo -u. The "right circumstances" depend on the fact that lilo saves a copy of your old boot program in the /boot directory. This is the file with the ".nnn" extension [does Linux call them extensions?] The number "nnn" is the major/minor device number that Linux uses internally. fd0 is 0200, hda is 0300, and sda is 0800. Disk partitions are numbered using the minor part so hda1 is 0301, and so forth. The number also identifies where the boot sector will be written back to if you try the uninstall. The lilo man page explains the uninstall command. As always, if your Linux system can already be booted, make yourself a boot disk before attempting this!

Normally, lilo avoids writing over a previously saved boot, so that even if you've run it several times since your install, it may still contain your previous bootstrap. This might be DOS, WIN95, a link to the OS/2 boot manager, a previous Linux setup, or even the blank space of an uninstalled disk. Success can't be guaranteed, but the more you know about how it operates, the greater your chances will be. Knowing what was on your disk originally is an important clue. Also you can make "backups" now that you know what's in that file.

Uninstall does not restore the map file, so if your problems are due to having edited or moved something, you need to work with your lilo.conf file to restore your system.

I give up! I need to get my Windows (or DOS) back!

If LILO is working correctly, maybe you just need to know how to add a Windows stanza.

To go back to square one, boot up from a DOS floppy, and enter the command:

This puts the DOS MBR code back without touching the partition tables. This is risky only if you have one of those disk overlay programs installed. Note that your Linux partitions are still intact, and you can still access them if you have the proper boot floppy or rescue disks.

Why do I have to rerun lilo each time I make a change?

Because lilo is actually an installation program. Read the above comments about the message file.

How can I make a boot floppy or rescue disk?

There are a number of ways to do this. Some are easier than others, while some are more instructive than others. You can copy a friend's rescue disk if he has a running system. You can often make a rescue disk using files found on your distribution CD. But for education's sake, let's go through the steps to create a rescue floppy, using a working system.

Floppy making has a page of its own.

Back