Lilo Page
 Edited Sunday, February 03 2008

Lilo boot loader is easy to install and set up. Quite a few Linux users still prefer to boot with LiLo. Some seem to think it is more reliable than Grub, or maybe they have used LiLo for a long time and just like it better.

Lilo is always installed with the main body of the boot loader in the Ubuntu file system (partition). The main part of a boot loader is called the 'stage2'. A much smaller 'stage1' part of LiLo is installed either in the MBR and in the first sector of the Linux partition, or just in the first sector of the Linux file system (partition).
 
If LiLo is 'installed to MBR', the smaller  stage1 code will be installed in the appropriate area reserved for it in the hard disk's Master Boot Record.
When installed to MBR, Lilo overwrites any existing boot loader code to make the MBR point to the other part of Lilo in your Ubuntu partition. From there LiLo can present the user with a menu that allows the user to choose which operating system to boot, if there is more than one operating system in the machine. In other words LiLo will be your computer's boot manager.
One reason some people might prefer LiLo is that it LiLo doesn't write anything to the remainder of the first track of the hard disk, the 62 sectors right after the MBR.

If you know you have some kind of special software installed to the first track, you should choose to 'install LiLo to MBR' when you install Ubuntu, instead of GRUB.
Other boot loaders or boot managers like GRUB or GAG, write code to sectors in the first track of the hard disk, which is normally empty anyway, and is not part of any file system.
In some computers though,  there could be some software or other files stored in the first track of the first hard disk that you may want to preserve. If you do have a computer with special software like that you would probably know about it as you should have been warned about its location by whoever or whatever program installed something there.

Special software that might be written to the first track of the hard disk in some computers is rare these days, but can include 'Ontrack disk manager', or Toshiba's 'Express Media Player'. I have also read of fancy keyboard drivers maybe, but I'm not sure if that's really true or not.

When LiLo is 'installed to the Linux partition', the stage1 code is only written to the first sector also called the 'boot sector', or 'boot block' of the Ubuntu partition.
If you choose that then LiLo won't touch your MBR at all, but you'll have to find some way to boot your Ubuntu partition by chainloading LiLo in the boot sector with a boot manager of your choice.
Boot managers you may use include GAG Boot Manager or GRUB or  even Windows NTLDR if you know how to configure it, (not recommended).

When installed to the Ubuntu partition, it overwrites any previously existing boot loader code in the partition's first sector.

Page Index
Editing /etc/lilo.config.  Not much here yet, website under construction.

Having Two Bootloaders at Once.

Installing Lilo during the installation when installing Ubuntu with the 'Alternate' install CD.

Install Lilo with apt-get from terminal in a running system

Run Liloconfig.

Get the Lilo Manual.



Install Lilo with Synaptic Package Manager...(in a running system)

Install Lilo from a Linux Live CD...An emergency method for installing Lilo.
                                               (Even works for an non-bootable Ubuntu installation)
Install Lilo from Breezy Install CD...An emergency method for installing Lilo.
                                               (Even works for an non-bootable Ubuntu installation)


Adding you own customized LiLo Splashimage 

Error messages from  LILO




Editing /etc/lilo.config
One thing users will need to know about Lilo is that after a kernel update, we need to edit /etc/lilo.config and run /sbin/lilo to update Lilo.
In Ubuntu we can get away without doing that for some time, because our old kernels don't get deleted right away. We keep them around for a time first. But who wants to be booting old out of date kernels when there are newer, better ones there? Someday the older kernels will be deleted, and you will be left with an operating system that won't boot if you don't bring your Lilo up to date now and again.

herman@bookpc:~$ sudo gedit /etc/lilo.config


# Generated by liloconfig

# This allows booting from any partition on disks with more than 1024
# cylinders.
lba32

# Specifies the boot device
boot=/dev/sda2

# Specifies the device that should be mounted as root.
# If the special name CURRENT is used, the root device is set to the
# device on which the root file system is currently mounted. If the root
# has been changed with  -r , the respective device is used. If the
# variable ROOT is omitted, the root device setting contained in the
# kernel image is used. It can be changed with the rdev program.
root=/dev/sda2

# Bitmap configuration for /boot/coffee.bmp
bitmap=/boot/coffee.bmp
bmp-colors=12,,11,15,,8
bmp-table=385p,100p,1,10
bmp-timer=38,2,13,1

# Enables map compaction:
# Tries to merge read requests for adjacent sectors into a single
# read request. This drastically reduces load time and keeps the map
# smaller. Using COMPACT is especially recommended when booting from a
# floppy disk.
# compact

# Install the specified file as the new boot sector.
# LILO supports built in boot sectory, you only need
# to specify the type, choose one from 'text', 'menu' or 'bitmap'.
# new: install=bmp      old: install=/boot/boot-bmp.b
# new: install=text     old: install=/boot/boot-text.b
# new: install=menu     old: install=/boot/boot-menu.b or boot.b
# default: 'menu' is default, unless you have a bitmap= line
# Note: install=bmp must be used to see the bitmap menu.
# install=menu
install=bmp

# Specifies the number of _tenths_ of a second LILO should
# wait before booting the first image.  LILO
# doesn't wait if DELAY is omitted or if DELAY is set to zero.
# delay=20

# Prompt to use certain image. If prompt is specified without timeout,
# boot will not take place unless you hit RETURN
prompt
timeout=50

# Specifies the location of the map file. If MAP is
# omitted, a file /boot/map is used.
map=/boot/map

# Specifies the VGA text mode that should be selected when
# booting. The following values are recognized (case is ignored):
#   NORMAL  select normal 80x25 text mode.
#   EXTENDED  select 80x50 text mode. The word EXTENDED can be
#     abbreviated to EXT.
#   ASK  stop and ask for user input (at boot time).
#   <number>  use the corresponding text mode. A list of available modes
#     can be obtained by booting with  vga=ask  and pressing [Enter].
vga=normal

# Defines non-standard parameters for the specified disk.
#disk=/dev/sda
#    bios=0x80

# If you are using removable USB drivers (with mass-storage)
# you will need to tell LILO to not use these devices even
# if defined in /etc/fstab and referenced in /proc/partitions.
# Adjust these lines to your devices:
#
# disk=/dev/sda inaccessible
# disk=/dev/sdb inaccessible

# These images were automagically added. You may need to edit something.

image=/boot/vmlinuz-2.6.20-15-generic
    label="Lin 2.6.20img0"
    initrd=/boot/initrd.img-2.6.20-15-generic
    read-only

image=/boot/vmlinuz-2.6.20-16-generic
    label="Lin 2.6.20img1"
    initrd=/boot/initrd.img-2.6.20-16-generic
    read-only

image=/boot/memtest86+.bin
    label="Memory Test+"
    read-only

# If you have another OS on this machine (say DOS),
# you can boot if by uncommenting the following lines
# (Of course, change /dev/hda2 to wherever your DOS partition is.)
# other=/dev/hda2
#   label="MS Windows"

This is what my /etc/liloconfig file looks like...
More information will be added here sometime soon.
(Website under Construction)
Actually, just read some of the great links I have to other LiLo web pages, those are some very good links, I don't really think I will be able to improve on those.                                                   

Links:

http://freshmeat.net/projects/lilo/

Link to an Excerpt on Lilo from Rute Linux User's Guide and Exposition by Paul Sheer

LILO mini-HOWTO

There are more good LiLo links in 'Tips For Linux Explorers',
here are a few of those,
The Lilo bootloader
Multiboot Lilo
Password Protect Lilo
Booting in Runlevel 3 ( Trick with Lilo )
Making a boot floppy
Boot/Rescue CD



Having Two Bootloaders at Once

Lilo and Grub can both be happily installed in the same Ubuntu file system and even share the same /boot directory.  That might be handy if you want to have one bootloader in a MBR and the other in a partition. That way you have two bootloaders. If you have trouble with one, you can still boot with the other.
Whichever bootloader is in the first sector of the partition can allow the Linux system to be chainloaded from alternative boot managers in the event of problems with the other bootloader. For example, it is common to lose your ability to boot Ubuntu following a Windows re-install which overwrites GRUB on a dual-boot MBR with Windows boot loader code. It is also possible for users to accidentally lock themselves out of their systems by making certain mistakes in editing Grub's menu.lst file. 
If Lilo is installed, you can still boot Ubuntu by using another boot manager like GAG Boot Manager from a floppy disk or CD-ROM. For more on GAG Boot Manager, visit my GAG Page.
Having Lilo installed means you always have an auxiliary method for booting your system. It's free except for the small amount of your time taken to install it, and does no harm. It can sit idle for months and you would forget it's even there...until an emergency when you need it!
Well, these days we have Super Grub Disk, but I used to use Lilo and GAG for an alternative boot method before Super Grub Disk became so well known.




Installing Lilo during the installation of Ubuntu with the 'Alternate' install CD

Most people who want to install Lilo would have installed it right from the outset, during the initial installation of their Ubuntu operating system.
This can be done easily with the 'Alternate' Ubuntu Install CDs. Here is a link to another page on this site that shows how that part of the 'Alternate' CD install works..............GO

One of the advantages of installing LiLo to MBR as opposed to GRUB is that LiLo only writes a little code to the IPL section of the MBR. GRUB writes to the MBR and also the next fifteen sectors of the first track of the hard disk. There are a few models of Toshiba Laptops that have the Express Media Player in the first track of their hard disk, so installing GRUB might not be the best idea.
If you think you might have something in the first track of your hard disk, you can install LiLo instead of GRUB. That way you only need to make a backup of your MBR, and if anything goes wrong you can restore your computer to the way it used to be just by restoring the MBR. You won't need to worry about backing up the rest of the first track of your hard disk.
Here is a link about how to back up and restore your MBR, MBR backup and restore.





Install Lilo from terminal

This is a method that most people would normally use for installing LiLo under normal circumstances if your operating system is already installed. We can use this method when your Linux Operating System is already up and running okay. Maybe we installed Grub to MBR during installation and now we want to add Lilo as well, installed in the partition's first sector. Or the other way around, we could install Lilo to MBR, overwriting grub's stage1 code. Later I'll show a couple of methods that can even be applied to an unbootable system.

Code:
herman@bookpc:~$ ls /boot
abi-2.6.17-10-generic     initrd.img-2.6.17-10-generic  Ubuntusplash.xpm.gz
abi-2.6.17-11-generic     initrd.img-2.6.17-11-generic  vmlinuz-2.6.17-10-generic
config-2.6.17-10-generic  memtest86+.bin                vmlinuz-2.6.17-11-generic
config-2.6.17-11-generic  System.map-2.6.17-10-generic
grub                      System.map-2.6.17-11-generic

This is just to show you what I had in my /boot directory before I started. There are no Lilo files here at all.

To begin installing Lilo, all I did was type 'sudo apt-get install lilo',
code:
herman@bookpc:~$ sudo apt-get install lilo
into a terminal and press 'enter', then type my password when asked.


herman@bookpc:~$ sudo apt-get install lilo
Password:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  lilo-doc mbr
The following NEW packages will be installed:
  lilo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/343kB of archives.
After unpacking 1098kB of additional disk space will be used.
Media change: please insert the disc labeled
 'Ubuntu 6.10 _Edgy Eft_ - Release i386 (20061025.1)'
in the drive '/cdrom/' and press enter
I had to put my CD in the drive and press 'enter', like it says.

Be sure to remember to remove the CD later. One time I got an urgent phone call and had to go to work in the middle of doing something like this and I left the CD in the drive. Someone else who didn't know what I had been doing came home and rebooted the computer and wiped the entire hard drive with the 'Alternate' CD installer.

Or, go to this website's Post-install Page and see how to hash out the line in /etc/apt/sources.list to prevent it asking for the CD at all from now on,  Enable Standard Repositories.  That way you will be installing software from the internet only.

 working...
Ubuntu Configuration


Configuring lilo

 LILO configuration

 It seems to be your first LILO installation. It is absolutely necessary to run liloconfig(8) when you complete this process and execute /sbin/lilo after this.

LILO won't work until you do this.

<Ok>



 fig2 Lilo
Just press your 'enter' key and this will go away. It is just to let you know that you have to run liloconfig to enable Lilo to be usable. The way to do that is the very next subject I'll cover, right under here.

Preconfiguring packages ...
Selecting previously deselected package lilo.
(Reading database ... 128285 files and directories currently installed.)
Unpacking lilo (from .../lilo_22.6.1-7ubuntu2_i386.deb) ...
Setting up lilo (22.6.1-7ubuntu2) ...
This is just to show you the rest of the text you'll see in the terminal after the blue and grey sign goes away.


herman@bookpc:~$ ls /boot
abi-2.6.17-10-generic         initrd.img-2.6.17-11-generic
abi-2.6.17-11-generic         memtest86+.bin
coffee.bmp                    sarge.bmp
config-2.6.17-10-generic      sid.bmp
config-2.6.17-11-generic      System.map-2.6.17-10-generic
debian.bmp                    System.map-2.6.17-11-generic
debianlilo.bmp                Ubuntusplash.xpm.gz
grub                          vmlinuz-2.6.17-10-generic
initrd.img-2.6.17-10-generic  vmlinuz-2.6.17-11-generic
herman@rocky:~$
This is my /boot directory now. As you can see there are now some Lilo files in it, where there weren't any before I started.
Stay tuned folks! Next we'll need to run liloconfig.









Running Liloconfig

To run liloconfig, all you need to do, is type 'sudo liloconfig' after your terminal prompt and press 'enter'.
code:
herman@bookpc:~$ sudo liloconfig


Package Configuration


LILO configuration

 WARNING!

Your /etc/fstab configuration file gives device UUID=2d58733e-b9be-4c9e-a6a1-c0a30f783341 as the root filesystem device. This doesn't look to me like an "ordinary" block device. Either your fstab is broken and you should fix it, or you are using hardware (such as a RAID array) which this simple configuration program does not handle.

You should either repair the situation or hand-roll your own /etc/lilo.conf configuration file; you can then run /usr/sbin/liloconfig again to retry the configuration process. Documentation for LILO can be found in /usr/share/doc/lilo/.

                                                                         <Ok>




The liloconfig program is complaining here because it has not yet been updated to handle the recent improvements developers have made in our Ubuntu /etc/fstab files. The Liloconfig program doesn't recognize our filesystem (partition) UUID numbers in our Ubuntu /etc/fstab. More details about filesystem UUID numbers can be found in my Filesystems and Mounting Page, here is the link, About Edgy Eft's new /etc/fstab files with UUID filesystem ID added.

We will work around this for now by editing our /etc/fstab files in the old style until Lilo is installed. 

herman@bookpc:~$ sudo cp /etc/fstab /etc/fstab.backup
This is to make a backup of our /etc/fstab file, so we can restore it again easily when we are finished. It's a good thing to have anyway, you never know when it might come in handy at some other time in the future as well.

herman@bookpc:~$ sudo gedit /etc/fstab
This opens our /etc/fstab file so that we can edit it.

# /etc/fstab: static file system information.
#
# <file system> <mount point>       <type>           <options>                <dump>  <pass>

   proc          /proc               proc             defaults                  0       0

#
/dev/hda2       
UUID=61e29deb-c5c3-4401-8557-81482aedc839  /   ext3    defaults,errors=remount-ro 0       1

# /dev/hda1
UUID=124D-170D   /media/hda1         vfat    defaults,utf8,umask=007,gid=46       0       1

# /dev/hda5
UUID=a08d44f6-d681-4901-a7cc-345fc9fa9eb6 none  swap     sw                       0       0

/dev/cdrom      /media/cdrom0     udf,iso9660         user,noauto                 0       0

/dev/fd0        /media/floppy0      auto             rw,user,noauto               0       0
Before.
To 'hash out' a line in a text file that programs will look at, we simply place a '#' mark before the line. That makes programs in the operating system ignore that line.
As you can see, the old style device names like 'dev/hda2'  that LiLo understands, have been hashed out in our new style /etc/fstab files in favor of file system UUID numbers.

# /etc/fstab: static file system information.
#
# <file system> <mount point>       <type>           <options>                <dump>  <pass>

   proc          /proc               proc             defaults                  0       0

#
UUID=61e29deb-c5c3-4401-8557-81482aedc839 
/dev/hda2           /                ext3    defaults,errors=remount-ro         0       1

#
UUID=124D-170D
/dev/hda1        /media/hda1         vfat    defaults,utf8,umask=007,gid=46      0       1

#
UUID=a08d44f6-d681-4901-a7cc-345fc9fa9eb6
 /dev/hda5        none               swap                 sw                     0       0

/dev/cdrom      /media/cdrom0     udf,iso9660         user,noauto                 0       0

/dev/fd0        /media/floppy0      auto             rw,user,noauto               0       0
After.
See, now the UUID numbers are hashed out (for now), and the fstab line are all edited to the traditional style?  
I had to do a little bit of fancy copying and pasting to get it looking like this, but now the UUID numbers are all behind hash marks and the lines without any hash marks are changed back to the old fashioned style /etc/fstab line style.

This is how I edited mine, you must make up your own mind how to edit yours in a similar fashion.  Save it and exit the text editor.
More information on editing /etc/fstab is in this link, Tuxfiles: How to edit and understand /etc/fstab



Now we are retrying the liloconfig again.
You can expect to be given some information (below) and asked five easy questions.
Package Configuration


LILO configuration

 Booting from hard disk.

You must do three things to make the Linux system boot from the hard disk. Install a partition boot record, install a master boot record, and set the partition active. You'll be asked to perform each of these tasks. You may skip any or all of them, and perform them manually later on.

This will result in Linux being booted by default from the hard disk. If your setup is complicated or unusual you should consider writing your own customized /etc/lilo.conf.  To do this you should exit this configuration program and refer to the comprehensive lilo documentation, which can be found in /usr/share/doc/lilo.


                                                                         <Ok>



All you need to do is press enter to move on to the next screen.

Package Configuration


LILO configuration

 Install a partition boot record to boot Linux from /dev/sda2?
 

                                  <Yes>                                                             <No>



fig3lilo
In this illustration I selected yes, I want to install a partition boot record to boot Ubuntu from /dev/sda2, which is my current Ubuntu partition in this computer.

Package Configuration


LILO configuration

 Install a partition boot record to boot Linux from /dev/sda2?
 

                                  <Yes>                                                             <No>







Package Configuration


LILO configuration

 The following is a list of the available bitmaps

                                                  /boot/sarge.bmp
                                                  /boot/sid.bmp
                                                  /boot/coffee.bmp       
                                                  /boot/debianlilo.bmp
 

                                  <Ok>                                                             <No>



  fig5lilo
This question is asking me which bitmap I would prefer for my Lilo splashimage. If you want to see what they look like, go to your /boot directory and open each one and take a peek.

I would imagine you would be easily able to make your own splashimages for Lilo later on too, if you want. You could use GIMP for doing that. Splashimages can be made from any digital photographs or artwork. They should be limited to 14 colors and 640 x 480 pixels as far as I know. I am not sure whether they can be another file type other than bitmap or not. Feel free to experiment. You would need to use a sudo command to copy your image files to the boot directory, then edit lilo.config with the path and name of your new bitmap splash screen image

For now I chose the coffee cup for mine. (Number 3), and I used my tab key to select 'okay'.

Package Configuration


LILO configuration

 A master boot record is required to run the partition boot record. If you are already using a boot manager, and want to keep it, answer "no" to the following question. If you don't know what a boot manager is or whether you have one, answer "yes".
 

                                   <Yes>                                                          <No>  



 fig6lilo
No, I don't want to install Lilo to MBR, at least not on this occasion. I am planning to use either GRUB or a boot manager (GAG) in MBR, to chainload the partition boot record (Lilo).

Most people would have chosen 'yes' here, for Lilo to take over as their main boot manager, (of all the operating systems in the computer), as well as boot loader for the Linux operating system we are working in now. For some people this will be desirable. The choice is yours.

LiLo is a very good boot manager and some people use in in the MBR in preference to GRUB or GAG because it only installs in the MBR and does not touch the rest of the first track of the hard disk.

I selected 'No' this time.

Package Configuration


LILO configuration

 The master boot record will boot the active partition. If you want your system to boot another operating system, such as DOS or Windows, by default, answer "no" to the following question. You may still use your boot manager or the master boot record to boot Linux. If you want the system to boot Linux by default, answer "yes". In this case you could still boot some other OS if you know what partition it is on.

Make /dev/sda2 the active partition? 

                                  <Yes>                                                             <No>



  fig7lilo
You can make a primary partition active  by setting the boot flag in the partition table, but not a logical partition.
You can also use a partition editor such as GParted -- LiveCD or Gnome Partition Editor (GParted installed in Ubuntu), do small jobs like that later on at any time you wish.

herman@red:~$ sudo liloconfig
Searching for installed kernels and updating image entries ...
Warning: Partition 2 on /dev/sda is not marked Active.
Warning: Unable to determine video adapter in use in the present system.
Warning: Video adapter does not support VESA BIOS extensions needed for
  display of 256 colors.  Boot loader will fall back to TEXT only operation.
Added Lin_2.6.20img0 *
Added Memory_Test+

OK. If you installed the master boot record, and the partition
boot record, you may boot Linux by holding down the shift key
as the system boots, and then pressing the 2 key
when you see the "1234F:" prompt.

For more information about LILO, see the documentation in
/usr/share/doc/lilo/. For details about the MBR, see also
/usr/share/doc/mbr/.
 fig8lilo When you get to the end you will be returned to your regular terminal prompt. Type exit to quit the terminal if you are finished with it.

That's it! Now you can boot Ubuntu with Grub in MBR or GAG Boot Manager via Lilo bootloader. Adding Lilo does not interfere with Grub or whatever bootloader you may have installed to MBR.
This gives a great alternative booting method in case something gets deleted or messed up with your other bootloader. It's a lot better to be able to just throw in your GAG CD and re-boot than it is to have to perform a file rescue and then re-install because you have locked yourself out of your operating system somehow.
Note:
You can now use Super Grub Disk to boot your computer with if it becomes accidentally unbootable due to some boot loader problem. Super grub Disk will bypass your MBR without touching it, (unless you want it to).
Super Grub Disk Page........................................................................Super Grub Disk Page




Get the Lilo Manual from /usr/share/doc/lilo/
herman@red:~$ cp /usr/share/doc/lilo/Manual.txt.gz  /home/herman
This will copy the Lilo Manual from inside your filesystem to your /home/username directory.  Replace my username, herman, with your own username, of course, unless your name is Herman too.

herman@red:~$ gunzip Manual.txt.gz
This command is to ungzip (uncompress) the manual so you can open it with a text editor. Go look for a text file in your /home/username folder called Manual.txt and open it. It is quite interesting, at least I think so. Not everyone will agree. Those who share my interest in bootloaders might.












Install Lilo from Synaptic Package Manager

This is another method that most people would normally use for installing LiLo under normal circumstances if your operating system is already installed and you can boot it. You can do this in any running Ubuntu operating system, even if you already have another boot loader already, like GRUB or GAG Boot Manager. A new directory called LiLo will be made in your /boot directory beside your GRUB or GAG directory and you can use whichever boot loader you decide to install to MBR (first sector of the first hard disk), or to the boot sector (first sector of the operating system's partition).



fig1lilo
LInux LOader - The classic OS loader can load Linux and others.
This package contains Lilo (the installer) and boot-record-images to
install Linux, OS/2, DOS and generic Boot Sectors OSes.

You can use LILO to manage your master boot record (with a simple text screen,
text menu or colorful splash graphics) or call LILO from other Boot-Loaders to
jump-start the Linux kernel.
....................................................................................................

fig2lilo
Configuring lilo
lilo configuration
It seems to be your first LILO installation. It is absolutely necessary to run liloconfig (8)
when you complete this process and execute /sbin/lilo after this.

LILO won't work if you don't do this.
                                                     X Cancel   < Back   > Forward
...................................................................................................

fig3lilo


Clicking forward allows the Synaptic Package Manager to install the software.
(Reciprocating bar bounces from left to right a few times).
....................................................................................................

fig4lilo
You will know Lilo has been installed, to check, look in the /boot directory. It has been populated with five new files.
                              coffee.bmp
                              debian.bmp
                              debianlilo.bmp
                              sarge.bmp
                              sid.bmp
...................................................................................................

After installing LiLo, you may need to run lilo config before LiLo will work, see Run Liloconfig.






Install Lilo from a Linux LiveCD
This method is an emergency method for installing Lilo, even when your Linux system is unbootable due to some other problem with your other bootloader. It should work even if there is no boot loader at all installed in the operating system.
Under normal circumstances it should be easier to install LiLo with apt-get or Synaptic Package Manager.
This procedure is only necessary if LiLo is not present in your operating system at all.
Note:
You can now use Super Grub Disk to boot your computer with if it becomes accidentally unbootable due to some boot loader problem. Super grub Disk will bypass your MBR without touching it, (unless you want it to).
Super Grub Disk Page........................................................................Super Grub Disk Page

This is yet another method for installing Lilo. This method can be done to an non-bootable system to try to make it bootable again.





Set the boot flag to the Ubuntu partition.  You can use any partition editor you like to change the boot flag.  Gnome Partition Editor in your Ubuntu Live CD is one of the best, 'System'-->'Administration'-->'Gnome Partition Editor'
Here is an example of how to use command line 'Parted for changing the boot flag, to start Parted, just type: sudo parted /dev/hda  in your terminal, or sda if you have a SCSI or Sata hard drive.
Code:
ubuntu@ubuntu:~$ sudo parted /dev/hda
You should be able to see in 'Parted or whatever partition editor you want to use, which of your partitions is your Ubuntu Partition that you want to install LiLo to. If you might forget, make a note of it. For example, is it /dev/hda2 or /dev/hda3 or something similar? You will need to know this number later on, for other commands.
Your computer might have different partitions to mine, so you must look for yourself to see what partition is your Ubuntu partition. In this example, my Ubuntu partition will be number 2 partition or in Linux terms, /dev/hda2.
If you have an SCSI or sata hard disk it might be called /dev/sda instead of /dev/hda.

ubuntu@ubuntu:~$ sudo parted /dev/hda
GNU Parted 1.7.1
Using /dev/hda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                             

Disk /dev/hda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  75.2GB  75.2GB  primary   fat32        boot
 2      75.2GB  157GB   81.9GB  primary   ext3              
 3      157GB   160GB   2887MB  extended                    
 5      157GB   160GB   2887MB  logical   linux-swap        

(parted)                         
Printout from 'Parted reveals that /dev/hda2 is not currently set active (the boot flag is on the first partition). 

If the boot flag does need to be moved, try;
code:
(parted) > set 2 boot on

Now type the print command again to make sure it worked,
(parted) print

Disk /dev/hda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  75.2GB  75.2GB  primary   fat32            
 2      75.2GB  157GB   81.9GB  primary   ext3         boot
 3      157GB   160GB   2887MB  extended                   
 5      157GB   160GB   2887MB  logical   linux-swap       

(parted) quit     
Type the command: quit   to exit the 'Parted shell.


Then, back in the plain bash shell,

Mount the Ubuntu install and edit /etc/fstab.
LiLo doesn't like Ubuntu's new style of /etc/fstab file with filesystem UUID numbers in it, so we need to change Ubuntu's /etc/fstab file to make it compatible with LiLo. First we need to mount the hard disk installed operating system though.
ubuntu@ubuntu:~$ sudo mkdir /mnt/ubuntu
This makes a new directory (folder) in /mnt and names it: ubuntu, this will be your mount point for your hard disk installed file system.

ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/hda2 /mnt/ubuntu/
Where: /dev/hda2 is your Ubuntu partition, since everyones computer can have a different partition scheme, you should refer to the note you mad when you looked at your partition table with your partition editor, as suggested and explained already.
Replace /dev/hda2 with whatever partition number is appropriate for your machine.

edit the entry for that in /etc/fstab.

ubuntu@ubuntu:~$ sudo cp /mnt/ubuntu/etc/fstab /mnt/ubuntu/etc/fstab.backup
This is to make a backup of our /etc/fstab file, so we can restore it again easily when we are finished. It's a good thing to have anyway, you never know when it might come in handy at some other time in the future as well.

ubuntu@ubuntu:~$ sudo gedit /mnt/ubuntu/etc/fstab
This opens our /etc/fstab file so that we can edit it.

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

proc            /proc           proc    defaults        0       0


# /dev/sda2
UUID=2d58733e-b9be-4c9e-a6a1-c0a30f783341  /   ext3    defaults,errors=remount-ro  0       1

/dev/sda1
UUID=3D4D-16F1  /media/sda1    vfat    defaults,utf8,umask=007,gid=46 0       1

# /dev/sda2
UUID=320D-180E  /media/sda2     vfat    defaults,utf8,umask=007,gid=46 0       1

# /dev/sda5
UUID=5d65f4b4-b659-460e-8bca-78328c4d6d23    none            swap    sw              0       0

/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
I have highlighted the line I need to change for my system. Almost everyone's system will be different, so yours will quite possibly be different from mine.
If you aren't sure which one is your Ubuntu partition, take a look first with any partition editor. GParted -- LiveCD is my favorite. It may be quicker to type 'sudo fdisk -lu' in a terminal, that's another good way to take a look at your partition table.

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

proc            /proc           proc    defaults        0       0


# UUID=2d58733e-b9be-4c9e-a6a1-c0a30f783341
/dev/hda2  /               ext3    defaults,errors=remount-ro 0       1

# UUID=3D4D-16F1  /media/sda1
/dev/sda1     vfat    defaults,utf8,umask=007,gid=46 0       1

# UUID=320D-180E  /media/sda2
/dev/sda2     vfat    defaults,utf8,umask=007,gid=46 0       1

# UUID=5d65f4b4-b659-460e-8bca-78328c4d6d23
/dev/sda5    none            swap    sw              0       0

/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0

To 'hash out' a line in a text file that programs will look at, we simply place a '#' mark before the line. That makes programs in the operating system ignore that line.
See, how the UUID numbers are hashed out now
, and the /dev/hda3 line is edited to the traditional style.  I had to do a little bit of fancy copying and pasting to get it looking like this, but now the UUID numbers are all behind hash marks and the lines without any hash marks are changed back to the old fashioned style /etc/fstab line style.

I also found out I had to change 'sda2' to 'hda2', to get everything to work okay for my computer.
(I actually have an IDE hard drive, but modern Ubuntu installs insist on calling it 'sda' regardless. LiLo doesn't seem to like that though).

This is how I edited mine, you must make up your own mind how to edit yours in a similar fashion, but not exactly like mine (unless your partition set-up is identical to mine). Save it and exit the text editor.
More information on editing /etc/fstab is in this link, Tuxfiles: How to edit and understand /etc/fstab

chroot into the Ubuntu install and apt-get and install Lilo (must be connected to the internet).
ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/ubuntu/proc

ubuntu@ubuntu:~$ sudo mount -o bind /dev/ /mnt/ubuntu/dev

ubuntu@ubuntu:~$ sudo chroot /mnt/ubuntu /bin/bash


root@ubuntu:/# apt-get install lilo   
Reading package lists . . .  Done
Building dependency tree . . .  Done
Suggested Packages:
   lilo-doc mbr
The following NEW packages will be installed:
   lilo
0 upgraded, 1 newly installed, 0 to remove and 128 not upgraded.
Need to get 343kB of archives.
After unpacking 1098kB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com dapper/main lilo 1:22.6.1-7ubuntu2 [343kB]
Fetched 343kB in 7s (48.0kB/s)
Preconfiguring packages . . .
Selecting previously deselected package lilo.
(reading database . . .  69523 files and directories currently installed.)
Unpacking lilo (from . . . /lilo_1%3a22.6.1-7ubuntu2_i386.deb) . . .
Setting up lilo (22.6.1-7ubuntu2) . . .lilo -b

root@ubuntu:/# lilo -b /dev/hda
This is to install LiLo's IPL or stage1 to a device, it could be to the Master Boot Record or to the boot sector of a partition.
-b /dev/hda3 means install LiLo to the first sector of partition 3.
-b  /dev/hda means to install LiLo to MBR.

root@ubuntu:/# exit
Exits the chroot to hard disk and returns you to a normal shell in the LiveCD.

ubuntu@ubuntu:~$ sudo umount /mnt/ubuntu/proc

ubuntu@ubuntu:~$ sudo umount /mnt/ubuntu/dev

ubuntu@ubuntu:~$ sudo umount /mnt/ubuntu


ubuntu@ubuntu:~$ exit


After installing LiLo, you may need to run lilo config before LiLo will work, see Run Liloconfig.

There is an interactive blog site for this how-to here, Bauer-Power by El Di Pablo. It's great to see people interested in helping others like that, I'm happy someone made a blog about this how-to, thank you El Di Pablo ! :)set

ubuntu@ubuntu:~$ sudo umount -a
If you had trouble getting /mnt/ubuntu unmounted, (I did), try: sudo umount -a
that worked for me.

============================================================










Install Lilo from Alternate Install CD

Below is ye olde method for installing Lilo even if your system is unbootable. This used to work with Ubuntu Warty and Hoary install CDs.
This method is an emergency method for installing Lilo, even when your Linux system is unbootable due to some other problem with your other bootloader. It should work even if there is no boot loader at all installed in the operating system .
NOTE: I tried this with a Dapper CD, and I could not get this to work. I have not tested this yet with an Edgy Eft, Fiesty Fawn or Gutsy Gibbon Alternate CD, but it might work.
Note:
You can now use Super Grub Disk to boot your computer with if it becomes accidentally unbootable due to some boot loader problem. Super grub Disk will bypass your MBR without touching it, (unless you want it to).
Super Grub Disk Page........................................................................Super Grub Disk Page


  INSTALL LILO BOOT LOADER TO UBUNTU PARTITION.....

(So you can boot with GAG boot manager).
GAG boot manager link: http://gag.sourceforge.net/
The GAG bootmanager does not need to disturb your MBR and can be used from a floppy disk or CD-ROM without affecting whatever bootloader you might have installed to MBR.
You can install GAG to your MBR later sometime if you want.
GAG boot manager is 'operating system independent', so you can install and uninstall operating systems without losing your boot.

When you use this method to install Lilo it is not necessary to run Liloconfig (shown above).


1. Boot the computer with the 'Breezy' install CD.

2. Complete the questions for the first stage of the installation as if you were installing, until       '[!!] Partition Disks' is reached.

3. Select 'Manual Partitioning'.

4. Select your Ubuntu partition.

5. (a) change mount point from /media/hda4 (or whatever) to /.
    (b) change 'bootable' off to 'bootable' (a progress bar will display).
    (c) choose 'done setting up the partition'.
    (d) choose 'finish partitioning and write changes to disk.

6. Sign says: 'If you continue, changes will be written to disk, etc,''Continue?'choose 'Yes'.

7. A red warning screen appears, saying 'Not installing to unclean target' choose 'continue'.

8. A second red warning screen says 'Install the base system failed' choose 'continue' again.         (we don't care!).

9. This sees you back in the 'Ubuntu Installer Main Menu', and once there you can scroll down      to 'Install Lilo boot loader to a hard disk'.

10. 'Install Lilo to target' '/dev/hda: new Ubuntu partition' (not your MBR if you are doing this         for GAG). A progress bar should display as Lilo gets installed.

11.A red warning screen appears, saying 'Not installing to unclean target' choose 'continue'.

12. A second red warning screen says 'Install the base system failed' choose 'continue' again.

13. Then you will be back in the 'Ubuntu Installer Main Menu' again, but be careful not to              press 'enter' on anything you don't want,but scroll down immediately to 'Abort Installation'.

14.Exit the installer.

15.Remove the install CD from your CD drive quickly as soon as you can before it boots from it again!

After installing LiLo, you may need to run lilo config before LiLo will work, see Run Liloconfig.

These instructions are almost the same as  vnbuddy2002's famous thread on how to restore GRUB, HOWTO: Restore GRUB (if your MBR is messed up. I have used the same basic idea but for installing LiLo instead of GRUB. 

============================


Adding you own customized LiLo Splashimage 

Source: Linux Desktop Hacks by Nicholas Petreley & Jono Bacon pages 16 & 17

Here's my interpretation of the above link,

1. Create or copy an image and open it in GIMP.  
    You can use your own digital art work or a digital photo or any image file.

2. Crop the image until it has a width x height ratio of 4:3 because next it will need to be able to be resized to 640 pixels wide x 480 pixels high.     (Press your Shift + C keys for the crop tool in GIMP)

3. Go: 'Image'-->'Scale Image', and scale (resize) the image to 640 x 480 pixels.

4.  Go 'Image'-->'Mode'-->'Indexed', and check the 255 colors are enabled and click 'Okay'.

5. Click 'File'-->'Save As', and give the file any name you want to make up, as long as you type .bmp at the end of it. For example: my_first_lilosplash.bmp

6. Copy the image file to your /boot directory.
herman@bookpc:~$ sudo cp my_first_lilosplash.bmp /boot

7. Edit /etc/lilo.config, adding the name and file path for the new splashimage file
herman@bookpc:~$ sudo gedit /etc/lilo.config
That should open your /etc/lilo.config file, so you can edit it.


Find this part of your lilo.config file,
# Bitmap configuration for /boot/coffee.bmp
bitmap=/boot/coffee.bmp
bmp-colors=12,,11,15,,8
bmp-table=385p,100p,1,10
bmp-timer=38,2,13,1

Delete the entry for the old LiLosplash

Replace it with the entry for your own
# Bitmap configuration for /boot/coffee.bmp
bitmap=/boot/
my_first_lilosplash.bmp
bmp-colors=12,,11,15,,8
bmp-table=385p,100p,1,10
bmp-timer=38,2,13,1

Save the changes.

8. Take a look at the book's instructions on pages 15 and 16, Linux Desktop Hacks
 about how to set up the font color, position and shading.
If you can set your font colors well it makes a huge difference to the way your splashimage will look, and it is well worth the time it might take.

Save and close the file.

9. Run lilo -v
herman@bookpc:~$ sudo lilo -v

10. Reboot and see how it looks.










Error messages from  LILO


The information in this section has been copied from the LiLo Manual, so none of this is my work.   I plan to try editing it a little for easier reading and then add some hyperlinks for your convenience.
You will find your own copy of the LiLo manual in your Ubuntu file system if you have LiLo installed, Get the Lilo Manual.

All parts of LILO display some messages that can be used to diagnose problems.

Boot loader messages
--------------------
The boot loader generates three types of messages:
Since messages of the latter type are usually self-explanatory, only the two other categories are explained.



LILO start messages
When LILO loads itself, it displays the word "LILO". Each letter is printed before or after performing some specific action. If LILO fails at some point, the letters printed so far can be used to identify the problem. This is described in more detail in the technical overview.

Note that some hex digits may be inserted after the first "L" if a transient disk problem occurs. Unless LILO stops at that point, generating an endless stream of error codes, such hex digits do not indicate a severe problem.

          (<nothing>)  No part of LILO has been loaded. LILO either isn't installed  or the partition on which its boot sector is located isn't active.

L <error> ...   The first stage boot loader has been loaded and started, but it can't load the second stage boot loader. The two-digit error  codes indicate the type of problem. (See also section "Disk error codes".) This condition usually indicates a media failure or a geometry mismatch (e.g. bad disk parameters, see section "Disk geometry").  

LI   The first stage boot loader was able to load the second stage boot loader, but has failed to execute it. This can either be caused by a geometry mismatch or by moving /boot/boot.b without running the map installer.

LIL   The second stage boot loader has been started, but it can't load the descriptor table from the map file. This is typically caused by a media failure or by a geometry mismatch.

LIL?   The second stage boot loader has been loaded at an incorrect address. This is typically caused by a subtle geometry mismatch or by moving /boot/boot.b without running the map installer.

LIL-   The descriptor table is corrupt. This can either be caused by a geometry mismatch or by moving /boot/map without running the map installer.
 
LILO   All parts of LILO have been successfully loaded.





=======================================================
Map installer warnings and errors
---------------------------------

Most messages of the map installer (/sbin/lilo) should be self-explanatory.
Some messages that indicate common errors are listed below. They are
grouped into fatal errors and warnings (non-fatal errors).


Fatal errors
- - - - - -

   Boot sector of <device_name> doesn't have a boot signature 

   Boot sector of <device_name> doesn't have a LILO signature
  
     The sector from which LILO should be uninstalled doesn't appear to be
    a LILO boot sector.

   Can't put the boot sector on logical partition <number>   
     An attempt has been made to put LILO's boot sector on the current root
    file system partition which is on a logical partition. This usually
    doesn't have the desired effect, because common MBRs can only boot
    primary partitions. This check can be bypassed by explicitly specifying
    the boot partition with the  -b  option or by setting the configuration
    variable BOOT.

   Checksum error   
     The descriptor table of the map file has an invalid checksum. Refresh
    the map file _immediately_ !

   Device 0x<number>: Configured as inaccessible.   
     There is a DISK section entry indicating that the device is
    inaccessible from the BIOS. You should check carefully that all files
    LILO tries to access when booting are on the right device.

   Device 0x<number>: Got bad geometry <sec>/<hd>/<cyl>   
     The device driver for your SCSI controller does not support geometry
    detection. You have to specify the geometry explicitly (see section
    "Disk geometry").

   Device 0x<number>: Invalid partition table, entry <number>   
     The 3D and linear addresses of the first sector of the specified
    partition don't correspond. This is typically caused by partitioning a
    disk with a program that doesn't align partitions to tracks and later
    using PC/MS-DOS or OS/2 on that disk. LILO can attempt to correct the
    problem, see "General per-image options".

   Device 0x<number>: Partition type 0x<number> does not seem suitable for
  a LILO boot sector   
     The location where the LILO boot sector should be placed does not seem
    to be suitable for that. (See also also section "Disk organization").
    You should either adjust the partition type to reflect the actual use
    or put the boot sector on a different partition. This consistency check
    only yields a warning (i.e. LILO continues) if the option IGNORE-TABLE
    is set.

   <device_name> is not a valid partition device   
     The specified device is either not a device at all, a whole disk, or a
    partition on a different disk than the one in whose section its entry
    appears.

   <device_name> is not a whole disk device   
     Only the geometry of whole disks (e.g. /dev/hda, /dev/sdb, etc.) can
    be redefined when using DISK sections.
   DISKTAB and DISK are mutually exclusive   
     You cannot use a disktab file and disk geometry definitions in the
    configuration file at the same time. Maybe /etc/disktab was
    accidentally used, because that's the default for
    backward-compatibility. You should delete /etc/disktab after completing
    the transition to DISK sections.

   Duplicate entry in partition table   
     A partition table entry appears twice. The partition table has to be
    fixed with fdisk.

   Duplicate geometry definition for <device_name>   
     A disk or partition geometry definition entry for the same device
    appears twice in the configuration file. Note that you mustn't write a
    partition section for the whole disk - its start sector is always the
    first sector of the disk.

   First sector of <device> doesn't have a valid boot signature   
     The first sector of the specified device does not appear to be a valid
    boot sector. You might have confused the device name.*
   geo_comp_addr: Cylinder <number> beyond end of media (<number>)   
     A file block appears to be located beyond the last cylinder of the
    disk. This probably indicates an error in the disk geometry
    specification (see section "Disk geometry") or a file system
    corruption.
 
   geo_comp_addr: Cylinder number is too big (<number> > 1023)   
     Blocks of a file are located beyond the 1024th cylinder of a hard
    disk. LILO can't access such files, because the BIOS limits cylinder
    numbers to the range 0...1023. Try moving the file to a different
    place, preferably a partition that is entirely within the first 1024
    cylinders of the disk.

   Hole found in map file (<location>)   
     The map installer is confused about the disk organization. Please
    report this error.

   <item> doesn't have a valid LILO signature   
     The specified item has been located, but is not part of LILO.

   <item> has an invalid stage code (<number>)   
     The specified item has probably been corrupted. Try re-building LILO.

   <item> is version <number>. Expecting version <number>.   
     The specified entity is either too old or too new. Make sure all parts
    of LILO (map installer, boot loaders and chain loaders) are from the
    same distribution. **

   Kernel <name> is too big   
     The kernel image (without the setup code) is bigger than 512 kbytes
    (or 448 kbytes, if built with  LARGE_EDBA ). LILO would overwrite
    itself when trying to load such a kernel. This limitation only applies
    to old kernels which are loaded below 0x10000 (e.g. "Image" or
    "zImage"). Try building the kernel with "bzImage". If this is
    undesirable for some reason, try removing some unused drivers and
    compiling the kernel again. This error may also occur if the kernel
    image is damaged or if it contains trailing "junk", e.g. as the result
    of copying an entire boot floppy to the hard disk.

   LOCK and FALLBACK are mutually exclusive   
     Since LOCK and FALLBACK both change the default command line, they
    can't be reasonably used together.
   Map <path> is not a regular file.   
     This is probably the result of an attempt to omit writing a map file,
    e.g. with  -m /dev/null . The  -t  option should be used to accomplish
    this.

   Must specify SECTORS and HEADS together   
     It is assumed that disks with a "strange" number of sectors will also
    have a "strange" number of heads. Therefore, it's all or nothing.
   No geometry variables allowed if INACCESSIBLE   
     If a device is configured as INACCESSIBLE (see section "Specifying the
    geometry"), its DISK section must not contain any geometry variables.

   No image <image> is defined   
     The command line specified either with the  -R  option or with
    FALLBACK does not contain the name of a valid image. Note that optional
    images which have not been included in the map file are not considered
    as valid.
 
   Partition entry not found   
     The partition from which an other operating system should be booted
    isn't listed in the specified partition table. This either means that
    an incorrect partition table has been specified or that you're trying
    to boot from a logical partition. The latter usually doesn't work. You
    can bypass this check by omitting the partition table specification
    (e.g. omitting the variable TABLE).
 
   Single-key clash: "<name>" vs. "<name>"   
     The specified image labels or aliases conflict because one of them is
    a single character and has the SINGLE-KEY option set, and the other
    name begins with that character.

   Sorry, don't know how to handle device <number>   
     LILO uses files that are located on a device for which there is no
    easy way to determine the disk geometry. Such devices have to be
    explicitly described, see section "Disk geometry".
 
   This LILO is compiled READONLY and doesn't support ...   
     If LILO is not allowed to write to the disk at boot time (see section
    "Build-time configuration"), options like LOCK and FALLBACK are
    unavailable.

   This LILO is compiled without REWRITE_TABLE and doesn't support ...   
     If LILO is not allowed to rewrite partition tables at boot time (see
    section "Partition table manipulation"), options like ACTIVATE and SET
    (in a CHANGE section) are unavailable. You may also get this error if
    LILO is compiled with  READONLY  enabled.

   Timestamp in boot sector of <device> differs from date of <file>   
     The backup copy of the boot sector does not appear to be an ancestor
    of the current boot sector. If you are absolutely sure that the boot
    sector is indeed correct, you can bypass this che