LILO (LInux LOader) Configuration Introduction 11.. PPuurrppoossee _L_i_n_u_x may boot using different mechanisms. Booting involves reading and placing in memory a kernel file (often called zImage or vmlinuz), then executing it. While this sounds simple, there are always some quirks to deal with. This is why booting an Operating System is a sort of ``black art.'' Unlike many boot loaders shipped with some other commercial OSs, _L_I_L_O is fully documented and one the most versatile loaders, by far. We will first try to describe what is involved, and then tell you what you can do with all that. 22.. LLIILLOO pprriinncciipplleess Without getting too deep, let's just explain what booting a PC is all about. 22..11.. TThhee FFiirrsstt IInnhhaabbiittaanntt:: TThhee BBIIOOSS When a PC starts, the first program to take control is the _B_I_O_S, which is resident in _R_O_M. After initializing most hardware in your machine, it attempts to load a tiny program, normally either from the first sector of the floppy or the first sector of the first hard drive. This program is called the _M_a_s_t_e_r _B_o_o_t _R_e_c_o_r_d or _M_B_R for short. 22..22.. FFrroomm tthhee MMBBRR ooff tthhee hhaarrdd ddrriivvee ttoo tthhee OOSS The _M_B_R of the hard drive, using the BIOS, does one of two things. The first possibility (like the MBR included with DOS) is that it locates the active partition and loads the first sector of _t_h_a_t partition. This sector contain a tiny little program which knows a little bit more about the internals of the _O_S living in that partition. It will proceed to load either basic components of the system or simply a more sophisticated boot loader which will finish the job. Alternatively, the MBR of the hard drive can load information directly from one of the partitions, and use that to load OS's on any partition. LILO can be configured this way; the OS/2 boot loader and Partition Magic, two other well-known bootloaders, do the same. 22..33.. TThhee ffllooppppyy''ss bboooott sseeccttoorr The boot sector of a floppy may be compared to the boot sector of the active partition. It normally proceeds to load the OS living on the floppy. 22..44.. AAnndd LLIILLOO _L_I_L_O is fairly flexible, here is why. +o It can be installed either as a replacement for the _M_B_R or as the boot sector of a partition, and still boot _L_i_n_u_x and most other OS's from any partition on any drive. +o It can be installed on the boot sector of the floppy and still perform its normal task, booting almost anything on the hard drive(s). +o Beside the boot sector, it has no hidden file, nor uses any special partition. Furthermore, its configuration files can be installed in any partition, even unrelated to _L_i_n_u_x, even in a subdirectory of a _D_O_S partition. +o It can boot several different kernel configuration and even several different kernels. +o It can boot more than one _L_i_n_u_x installation. +o It can boot linux on any drive. 22..55.. LLIILLOO,, LLiinnuuxx,, aanndd tthhee wwoorrlldd When installing _L_i_n_u_x on a system with several OS's (besides _L_i_n_u_x), take this as a rule of thumb: Install and configure booting for all the other OS's first, because they are less flexible. It will then be easier to set up LILO to boot all the other OS's 33.. LLIILLOO ccoonnffiigguurraattiioonn ddiiaalloogg Now that you know a little bit what _L_I_L_O can do, let see how you can configure it using _L_i_n_u_x_c_o_n_f. The main configuration dialog is split in sections. Here is an introduction to each section. 33..11.. GGlloobbaall ffeeaattuurreess This section deal with how to install _L_I_L_O. 33..11..11.. DDiissaabblliinngg LLIILLOO If you boot your _L_i_n_u_x system without _L_I_L_O, you may find _L_i_n_u_x_c_o_n_f a little bit annoying as it tries to make sure _L_I_L_O is properly set up all the time. You can disable _L_I_L_O support from _L_i_n_u_x_c_o_n_f at any time. This only affects _L_i_n_u_x_c_o_n_f though. This does nothing else. It won't UN-install _L_I_L_O. It just says to _L_i_n_u_x_c_o_n_f ``stop checking lilo''. 33..11..22.. IInnssttaallll bboooott sseeccttoorr oonn _L_I_L_O is brought to life at boot time by running a tiny, tiny program, called the bboooott sseeccttoorr. This program must be installed in a strategic location. The pop-up list of this field offers you a list of valid choice is order of preference. If _L_i_n_u_x is the aaccttiivvee partition it does not matter much. If it is not, or your _L_i_n_u_x partition is not on the first hard drive, you must install the boot sector either on the master boot record of the first drive, or on a boot floppy. Note that installing the boot sector on a boot floppy is still pretty fast, because only one sector is read from it. All other files still lives in the _L_i_n_u_x partition on your hard drive. If you have another boot manager (The _O_S_/_2 _b_o_o_t _m_a_n_a_g_e_r for one, Partition Magic for another), then a safe choice is to install the boot sector right in the linux partition. You will have to tell your other boot manager about this new partition. The _O_S_/_2 _b_o_o_t _m_a_n_a_g_e_r can boot (as LILO) linux even if it is located on a second hard drive (not the primary one). 33..11..33.. BBiiooss bboooott mmooddee Known to boot faster. Known not to work on some machines. I have no experience with it. 33..11..44.. BBoooott ttaabbllee eennccooddiinngg LILO creates a table which lets the boot loader locate the kernel files. This encoding is either done as track/head/sector or as a linear block number. With some SCSI controllers, the first strategy does not work. If you experience this, try to use the linear mode. Most modern computers work fine when you use a linear block number. 33..11..55.. PPrreesseenntt tthhee LLIILLOO pprroommpptt With this option, LILO will show its prompt. This option is on by default LILO boot: From there you can +o Boot a different OS or a different configuration +o Pass boot-time parameters to the kernel At the prompt, you may select a configuration; press the TAB key to get a list of configurations. Type the label of a configuration or simply hit the key to select the default configuration. If you need to pass boot-time parameters to the kernel, you will need to type the name of the configuration first, even if it is the default configuration. 33..11..66.. PPrroommpptt ttiimmeeoouutt Without a timeout, LILO will wait forever at the prompt. You can specify a timeout after which LILO will boot by itself the default configuration. The default timeout is 5 seconds. 33..11..77.. BBoooott ddeellaayy LILO may boot right away or wait some time before presenting the boot: prompt (if it is configured to show the prompt) or booting (if it is not configured to show the prompt). During this wait, you can intercept the boot sequence by typing shift-tab; LILO will then present you with its normal boot: prompt. If you disable the prompt, a boot delay of 5 seconds is recommended. Entering 0 disables this delay. 33..11..88.. MMeessssaaggee ffiillee You must put the path of a text file. Ideally, the text will be short and will fill the screen, leaving the _L_I_L_O prompt at the bottom. This is used for the boot floppies of some distributions. You can use it, for example, to give boot instructions to users in a lab or to family members who might not remember which keys to press. 33..22.. DDeeffaauullttss This section provides the default configuration, which Linuxconf applys to the different _L_i_n_u_x configuration entries. Entering information here allows you to avoid entering it repeatedly later. 33..22..11.. RRoooott ppaarrttiittiioonn You must tell where your _L_i_n_u_x root partition is sitting. A pop-up list gives you a list of all partitions. 33..22..22.. RRaamm ddiisskk ssiizzee Ram disk are used for installation boot disks. They are seldom used for full configuration. Recent development of kernel modules have made ram disk runtime configurable. A value of 0 disable the ram disk feature. 33..22..33.. BBoooott mmooddee:: RReeaadd oonnllyy?? Normally this flags is on. For _U_M_S_D_O_S installation, it is off. _U_M_S_D_O_S installation will generally use _l_o_a_d_l_i_n to boot instead of _L_I_L_O anyway. Unless you really what you're doing, then leave it on. Here is why: When _L_i_n_u_x boots in read-only mode, it is allowed to do much inspection of the partitions without touching them at all. This is good especially if the boot follows a crash which has left the partitions in a weird state. Why all the fuss about not touching the partition? Well, _L_i_n_u_x support multiple time stamps per file. One is the "last access date". This means that the file system is changed (data is written to the disk) just by reading files (which is exactly what happen at boot time). This last access time stamp is pretty useful, but becomes a nuisance at boot time. The "read only" tells _L_i_n_u_x to drop this behavior. After the partition has been checked, the system will set back to "read write" mode automatically. 33..22..44.. BBoooott ooppttiioonnss Some drivers required some information to correctly initialized themselves. For example, some CDROM drives do not correctly identify themselves. In order to tell Linux to consider your (rather broken) CDROM drive as a CDROM drive, you might need something like this: hdc=cdrom This will tell Linux that the master IDE device on the second IDE interface (that is, /dev/hdc) is a CDROM device. 33..33.. LLiinnuuxx sseettuuppss The default section is followed by several identical sections. Each defines one _L_i_n_u_x boot configuration. Each boot configuration repeats all the parameter of the default section. You can simply override them in each section if you wish to change them. The first configuration will be the default one. This means that _L_I_L_O will boot this one unless told differently at the boot: prompt. Only 3 fields differ from the default section. 33..33..11.. DDeelleettee tthhiiss ccoonnffiigguurraattiioonn If you check this box, the configuration will disappear when you will hit the accept button. 33..33..22.. KKeerrnneell iimmaaggee ffiillee This is the path of the kernel file which will boot for this configuration. Note that one kernel file may be used within several configurations. 33..33..33.. LLaabbeell This is a short name uniquely identifying the configuration. Given that a kernel file may be shared by several configuration, we need a unique key. This will be used when intercepting the boot process. _L_I_L_O expect simply a label name and will boot the corresponding configuration. 33..44.. OOtthheerr ooppeerraattiinngg ssyysstteemm _L_I_L_O is able to boot almost anything. For each OS you want to boot, simply specify the partition and a label. _L_I_L_O simply load the boot sector of that partition and launch it. 44.. MMoovviinngg LLIILLOO ccoonnffiigguurraattiioonn ffiilleess Sometimes, one must play with _L_i_l_O's configuration file. The good news is that, first, they are movable, second, you can tell Linuxconf about it. Just go to the "List all configuration files" menu, scroll to the /etc/lilo.conf line and select the edit button. Enter the new path of the _L_I_L_O configuration file. Be aware that _L_I_L_O expect to find its configuration file in /etc/lilo.conf. When moving the file, it has to go to a subdirectory holding a etc subdirectory in which you will place the file lilo.conf, for example, /mnt/tmp/etc/lilo.conf. 44..11.. WWhhyy mmoovvee LLIILLOO aannyywwaayy?? There are different reason why one would want to do this. Here are some. +o Your hard drive has more that 1024 cylinders and the root partition goes beyond the 1024th cylinder. _L_I_L_O uses the BIOS to load the kernel files (among other things). If the kernel file lies above the 1024 cylinder limit, _L_I_L_O won't be able to boot properly. LILO will tell you this right away at install time. +o Your root partition is located on the third or fourth hard drive and your BIOS (again) is too old and does not know about this second IDE channel. In this case, LILO will warn you at install time that some BIOS can't access the drive. At boot time you will get a bunch of errors. On the other hand, some distributions properly install all the files needed for booting in a /boot directory, which is kept in a separate partition if your root directory is not entirely below the 1024 cylinder mark. In that case, you are not likely to need to move LILO at all. 44..22.. HHooww ttoo mmoovvee?? WWhheerree?? On a machine dedicated to Linux, where you have a large drive with more than 1024 cylinders, many people will create a smaller partition for the basic OS and a larger for the data, insuring that all LILO file fits under the 1024 cylinder limit. This is often annoying as it makes management more complex. You end up with two partition partly filled. Another solution is to create a very small partition (few megs) at the beginning of the disk and reserve that for _L_I_L_O configuration and kernel files. This way you can create a single large root partition which is nicer to manage. (one can argue that creating a single large partition is a bad idea as it puts all the eggs in the same bag. Given the design of the EXT2 file system which distribute management information all over the partition, with replication, I doubt this apply anymore). So you have a partition which fits the bill. It is all accessible from the BIOS. Here are the steps to follow. Suppose this partition in mount under the lilo directory and you want to put all configuration files in the root of this partition. +o mkdir /lilo/etc +o cp /etc/lilo.conf /lilo/etc/lilo.conf +o mkdir /lilo/boot +o cp /boot/* /lilo/boot +o cd / +o tar cf - dev | (cd /lilo && tar xvf -) +o cp /vmlinuz /lilo You can activate this moved configuration like this /sbin/lilo -r /lilo And you can do this with Linuxconf by telling the /etc/lilo.conf is now /lilo/etc/lilo.conf. From now on, using Linuxconf, this should be completely invisible to you or whoever manage your machine. 55.. AAlltteerrnnaattiivveess ttoo LLIILLOO _L_i_n_u_x can be boot from a plain floppy or using loadlin. All this is unrelated to _L_I_L_O but it is good to know about it. Assuming your _L_i_n_u_x root partition is /dev/hdaX... 55..11.. UUssiinngg aa ffllooppppyy To create a simple boot floppy, just to this +o cp zImage /dev/fd0 +o rdev /dev/fd0 /dev/hdaX +o rdev -R /dev/fd0 1 55..22.. UUssiinngg llooaaddlliinn To boot with loadlin (A _D_O_S program), just copy the kernel file to your _D_O_S partition and type, at the _D_O_S prompt: loadlin zimage root=/dev/hdaX ro