LILO Emergency Room -- Hey, this info is nice, but I need help now!

How can I put LILO back into my MBR?

If you previously had a working Linux system, and your had LILO in the MBR, and "something" has overwritten your boot, and you can still bring up your Linux system using an emergency boot or rescue disk, then all you should need to do is type 'lilo'. This installs LILO into your MBR. This is really just lilo's job anyway. You may lose the functionality of the "something" but often you can have LILO boot it after some tweaking (the exception is Windows NT).

If LILO (not Linux) boots from a disk partition, then you presumably have some kind of boot manager in your MBR. If this is gone, we can't put it back.  Only the system that put it there can.  Though it may be possible to replace it with LILO and dispense with that boot manager entirely. But that is not a rescue question; it is a change of system configuration. If the boot manager is intact, then running /sbin/lilo from Linux should put LILO back into the partition--assuming it was already configured to do that. Then you have to convince your boot manager to boot the partition LILO is installed in.

If your Linux wasn't working then you probably should be reading about rescue disks instead.

If your Linux "just went away" for no apparent reason, you may have found one of the problems caused by forgetting to run lilo after changing something; but the cure would be the same: Get the system up using a floppy disk and then run lilo to set the changes properly.

Why does Red Hat bomb installing LILO?

I don't know yet, but I want to find out. It happened to me, it happened to a friend, it has happened to people on the 'net who posted the same problem.  Here's my story, if I may tell one, so far...

Microsoft Windows (wannabeamacintosh) has the motto "Pay no attention to that man behind the curtain!" You, the user, do not need to trouble yourself with how things are done.  If they go wrong, you probably need an upgrade, right?

Well, in the wonderful world of Linux, you can peek behind the curtain! In the Red Hat installation, (and I'd bet this is true for any of them that run from a script), you can switch virtual consoles (ALT-F1, ALT-F2, et cetera), and you can see the programs the script is running. For example, when the disk is being formatted, you can switch over and watch format running. On the third console should be the program that's running the script itself.

In my case, when it tried to install LILO, it couldn't. I switched to one of the other consoles and saw "insmod failure". I had no idea at the time what it was, but it seems that insmod installs modules (at least that much makes sense). In the resulting system (I fixed it using methods detailed here) I do not have cdrom access, nor can I print. These also seem to be related to loading modules in this kernel (2.0.34). In my case the modules directory is empty and that differs with others' results, so my experience may be different.  Nonetheless, something prevented LILO from being installed, and yet I was still able to recover the system.

I intend to try to repeat the experiment at a later date.

All I get when I start is " L I "

Each letter in the sequence "LILO" is actually a milestone marker as the booting progresses. LI is by far the most common result.  This usually means the boot sector on the disk is intact but none of the other files are where they are expected to be. For details on the booting sequence, read the L-I-L-O page.

To fix this problem you must obtain or construct a rescue disk, get your system running, and then use lilo to install a working bootloader.

Here are a few reasons you may see this:

  1. After a first-time install of Linux, and something has gone wrong.  This is why it is important to make a boot floppy during the install process. A possible cause is locating the /boot directory past the 1024 cylinder limit found in pre-Pentium BIOSes. Less common is bad entries in lilo.conf, because lilo refuses to install if it sees anything it doesn't like in lilo.conf.

  2. Confusion among more than one computer or Linux install. Many 'boot floppies' have references to files on the hard drive. Thus it will only work on the hard drive with which they were made.  This means it will not work in your friend's computer. It also will not work in your machine if you redo the install. Now this is Linux, and you do have control over how you make these disks.  It is possible to make one that boots in other machines. Study the information here and you can learn how to make such a rescue disk.

  3. For more advanced users, recompiling the Linux Kernel produces new files that now must be linked to LILO. This means checking lilo.conf and running lilo again to inform it about the new kernel. If the old kernel is deleted and the disk space reclaimed without running lilo you can create a situation where you cannot boot. One more reason to have the rescue disk handy. Experienced developers always keep a known good kernel around and have it listed in lilo.conf as well.

My MBR is trashed because it stops after " L I "

No it isn't.  L and I are printed by code in the primary bootloader, which is what lives in the MBR.

How do I uninstall LILO?

Try lilo -u if you just had something that works and now after running lilo something bad is happening.  This puts the previous boot back (if there wasn't an older "previous" boot already). For more information, go back to the home page and read about the same topic, listed under "Mr. Curious".

Windows (DOS, NT, ...) ate my LILO partition!  Now what?

When you install another operating system it naturally wants to have your computer start it when you turn the power on. Thus it modifies the MBR, overwriting LILO.  Almost certainly your Linux system is intact; you just need to get control and reinstall LILO. But since this will likewise disable the other operating system, what you really need to do is decide on a multiboot strategy so you can access all your operating systems. Take a look around this site or search the Web for HOWTO documents about booting multiple operating systems.  If you know that you want LILO in control, take a look at the first question on this page.

How can I fix LILO without repeating the whole install?

If Linux was installed (root directory and all that) then you can "get back in" and set up LILO.  There is nothing magic about the Linux install process as far as LILO is concerned.  Don't waste your time by repeating it! In fact, in the Slackware distribution, the lilo installation step is simply the program 'liloconf' ! So, step one is to get your Linux system running:

In all the above cases, the key is to remember (or figure out by trial and error!) where the Linux root directory was installed and then specify it to the kernel when you boot up.  At LILO's boot: prompt, you enter a line like:

boot: linux root=/dev/hda2

The key is to identify the correct disk partition and use it where you see hda2 in the above example. Then perform step two, which is to fix /etc/lilo.conf (now you know where your root partition is!) and install LILO using /sbin/lilo.

The hard drive isn't even trying to boot!

There are a variety of similar conditions with messages like:

Boot Failure
Non system disk, press any key to reboot
No ROM BASIC, system halted

Generally speaking, you need to have one of your primary partitions marked "active". This can be done using fdisk. The DOS MBR program is supposed to be responsible for this but lately we have observed some PC BIOS programs that are a little too smart--they won't boot the hard drive if they can't find an active partition, even if you've got a perfectly good LILO installation in the MBR.

Back