LILO is a utility designed to load a Linux kernel (or another operating system) into memory and launch it. It has two parts:
A two-stage program intended to find and load a kernel. The first stage resides in the disk boot sector and is started by the system BIOS. It locates and launches a second, larger stage residing elsewhere on disk.
The map installer, used to install and configure the LILO boot loader. It reads /etc/lilo.conf and writes a corresponding map file.
The /etc/lilo.conf file contains options and kernel image information. Popular directives are:
boot
The name of the hard disk partition that contains the boot sector.
image
Refers to a specific kernel file.
install
The file installed as the new boot sector.
label
Provides a label, or name, for each image
.
map
Directory where the map file is located.
prompt
Prompts the user for input (such as kernel parameters or runlevels) before booting and without a keystroke from the user.
read-only
The root filesystem should initially be mounted read-only.
root
Used following each image
, this specifies the device that should be mounted as root.
timeout
The amount of time, in tenths of a second, the system waits for user input.
Runlevels specify how a system is used by controlling which services are running.
Runlevels are numbered through 6, as well as with a few single characters.
Runlevel 0 implies system shutdown.
Runlevel 6 implies system reboot.
The intermediate runlevels differ in meaning among distributions.
Runlevel 1 (also s or S) is usually single-user (maintenance) mode.
Runlevels 2 through 5 usually define some kind of multiuser state, including an X login screen.
Runlevel 1 is a bare-bones operating environment intended for maintenance. Remote logins are disabled, networking is disabled, and most daemons are shut down.
Single-user mode can be entered with the single
, or simply 1
, parameter at the LILO prompt.
The /etc/rc.d file contains initialization scripts and links controlling the boot process for many Linux distributions:
The startup script launched by init at boot time
A script for local startup customizations, started automatically after the system is running
A script used to change runlevels
The directory containing scripts to start and stop system services
Links to scripts in init.d
Names of the links are [K
|S
][nn
][init.d_name
]:
K
and S
prefixes mean kill and start, respectively.
nn
is a sequence number controlling startup or shutdown order.
init.d_name
is the name of the script being linked.
The default
runlevel
is located in /etc/inittab on the line containing initdefault
:
id:
n
:initdefault:
n
is a valid runlevel number such as 3.
Runlevel is determined by the runlevel command, which displays the previous and current runlevels. An N
for previous runlevel indicates that the runlevel has not changed since startup.
Runlevels can be changed using init:
n
Change to runlevel n
.
System shutdown can also be initiated using shutdown:
shutdown
time
Bring the system down in a secure, organized fashion. time
is mandatory, in the form of hh:mm, now
, or +n
for n
minutes.