Linux System Administration: Using LILO, The Linux Loader
In general, the boot process on a microcomputer has three stages: the system's master boot record (MBR) contains the primary boot program which starts the boot process and loads a secondary boot program from the boot blocks of the active partition; this second boot program is what loads the actual kernel.
Linux provides LILO, the Linux Loader, which can function as either a master boot program or a secondary boot program. lilo is installed with a command like this one:
# lilo -C /etc/lilo.conf
The -C option specifies the location of LILO's configuration file. (The location in the preceding command is, in fact, the default location, and so the -C clause is redundant.)
The lilo.conf file specifies LILO's behavior for certain aspects of the boot process and also defines the kernels and operating systems that it can boot. The following excerpt from a lilo.config file lists the most important entries—and the ones that you are most likely to want or need to modify:
# Wait 10 seconds before autobooting 1st entry.timeout=100 # Allow user to enter a boot command. prompt # Where to install/configure LILO # (no partition #=MBR) [see below] boot=/dev/hda ... # Text file displayed before boot prompt. message = /boot/boot.message # # Default kernel is the first one listed. image = /vmlinuz # Boot prompt command to boot this kernel. label = linux # Fix for Sony CD-ROM (post 1.1.72) # Specifies parameters to pass to kernel, # changing CD-ROM's compiled-in I/O address. append = "cdu31a=0x340,0," # # An alternate Linux kernel image = /safe # Its boot command label = safe append = "cdu31a=0x340,0," ... # A different operating system (DOS) other = /dev/hdb1 # Use the D: drive boot loader. loader = /boot/any_d.b # Use this partition table. table = /dev/hdb # This is the corresponding boot command. label = ddog
[I tend to install LILO both in the MBR and the Linux partition for maximum flexibility, by running a second LILO command using its -b option (which replaces the boot entry in the configuration file):# lilo -b /dev/hda1 -C /etc/lilo.confThis way, if I decide to remove LILO from the MBR, I'll be all set to switch over to the Linux partition version.]
The final section (“stanza”) illustrates the format for booting a DOS partition on the second hard disk; it uses an alternate loader, any_d.b, which tricks DOS into thinking it's on the C: drive. There are also loaders provided for OS/2 on the D: drive and DOS on the B: drive (os2_d.b and any_b.d, respectively; chain.b is the default loader for other operating systems).
If the label for a stanza is omitted, it defaults to the final component of the image or other entry (for example, vmlinuz or hda1).
The entry for a DOS partition on the C: drive is simpler, looking something like this:
other = /dev/hda1 label = dos table = /dev/hda
This stanza is actually what you need for any foreign operating system on /dev/hda1. There is one additional trick needed if SCO Unix is the operating system you want to boot. In order for LILO to successfully boot a SCO Unix partition, that partition must be the only active partition on the C: drive. This means you will have to turn off the active (boot) flag on the Linux partition and turn it on for the SCO Unix partition, using the Linux fdisk or cfdisk, before trying to boot SCO Unix (in addition to running LILO to install the new configuration). Note that LILO must be the master boot loader in this case.
Note: You will need to rerun the LILO command to reinstall it every time you rebuild the kernel or change any relevant aspect of the disk partitioning scheme. If you forget to do this, the system will not boot and you'll have to boot from a floppy. You will also need to rerun LILO if you change the text of the boot.message file.
Booting a Linux partition on the second hard drive is also possible. For this to work, LILO must be installed in the MBR of the system's boot disk, as well as the secondary boot program in the Linux partition itself—this is usually taken care of when you install Linux on the hard disk and will be assumed in what follows. In this case, the best way to proceed is in two stages:
First, set up a lilo.conf like this one:
boot=/dev/hdaroot=current image=/vmlinuz label=linux other=/dev/hda1 unsafe other=/dev/hda2 unsafe ... other=/dev/hdb4 unsafe
Define all of the partitions on both hard disks in the same way; the unsafe keyword tells LILO not to read the boot blocks or the disk's partition table for that entry—it basically says, “Trust me and do what I tell you.” Install this LILO configuration, and make sure that Linux is bootable.
Then, modify the file, changing entries for any bootable partitions on /dev/hda to their correct form and removing ones you don't need, and rerun the LILO command.
It is also possible to boot a Linux partition on each of two disks. The procedure for doing so is the following:
Decide which one will be the usual Linux boot partition and set up LILO to boot it and any other non-Linux operating systems on both disks. Create an entry like the following for the second Linux partition:
other = /dev/hdb2 label=eviltwin unsafe
Create a boot.message file which tells you which Linux will be booted when you select the default option. Install this configuration into the MBR on the C: drive.
Create (or retain) another LILO configuration for the second Linux partition, this time including an unsafe entry for the first Linux partition if you want to (this again assumes that LILO is installed in that partition, which usually happens at upon installation of the OS). Make sure that this partition's boot.message file also lets you know where you are. Install this configuration into the Linux partition only—make sure that the boot entry specifies the partition and not the disk as a whole.
The boot sequence will then go something like this:
Welcome to gallant.Boot choices: linux (default; on C:), dos, eviltwin (Linux on D:), sco boot: eviltwin Welcome to goofus. Boot choices: test (default; on D:), goodtwin (Linux on C:) boot: [Return] Loading test...
Given these selections, Linux will boot from the D: drive. What happens is the LILO from the MBR on drive C: runs first, and it then starts the boot program on the Linux partition on the D: drive—which is again LILO. That (second) LILO then loads the kernel from the D: drive. (Note that if you wanted to, you could just keep popping back and forth between the LILO programs on C: and D: ad infinitum.)
If you think this is pretty silly, then omit the prompt keyword from the LILO configuration file for the D: drive (as well as its image section for the Linux partition on the C: drive), resulting in a simple lilo.conf file on the D: drive:
install=/boot/boot.bboot=/dev/hdb2 root=/dev/hdb2 map=/boot/map image=/vmlinuz label=linux
Once this is installed, selecting eviltwin at the initial boot prompt will immediately boot the Linux partition on the second hard disk.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- A Topic for Discussion - Open Source Feature-Richness?
- Tech Tip: Really Simple HTTP Server with Python
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




2 hours 57 min ago
5 hours 12 min ago
5 hours 41 min ago
6 hours 39 min ago
8 hours 8 min ago
9 hours 16 min ago
10 hours 3 min ago
16 hours 39 min ago
22 hours 17 min ago
1 day 4 hours ago