How Linux booting Works at startup

The following steps outline how the Linux boot process works:

1. The first thing a computer does on start-up is a primer test, POST (Power On Self Test). Several
devices are tested, including the processor, memory, graphics card, and the keyboard. Also, the
boot medium (hard disk, floppy unit, and CD-ROMs) is tested. After POST, the loader from a ROM
loads the boot sector, which then loads the operating system from the active partition. You can
change boot medium sequence by editing the server BIOS.

2. The boot sector is always at the same place—track 0, cylinder 0, head 0 of the boot device. This
sector contains a program called loader (for Linux it is usually LILO or GRUB); this actually
boots the operating system. Either loader is installed at the MBR or at the first sector of the
active primary partition.

3. If you have multiple operating systems installed on your server, you need to select which one you
want from the boot loader menu. You can also select which kernel to load in this menu if you have
multiple kernels installed.

4. Then, the boot loader decompresses and loads the kernel. The kernel will load kernel modules first,
then detect hardware (floppy drive, hard disk, network adapters, etc.), verify hardware
configuration, and then scan and load device drivers.

5. At this stage, the kernel will mount the root file system and system files. The location of system
files is configurable during recompilation or with other programs. If the mount fails, a kernel
panic will occur, and the system will freeze. This is the type of mount failure mentioned earlier.

6. Next, the kernel will start the system initialization process init which will become process number
one. It will then start the rest of the system. The init process is Linux’s first process, parent
to all the other processes. This process is the first running process on any Linux/UNIX® system; it
always has a PID of 1.


7. Then, the init examines the file /etc/inittab to determine what processes have to be launched. This
file provides init information on runlevels and on which processes should be launched on each
runlevel. After that, init looks up the first line with a sysinit (system initialization) action
and executes the specified command file, like /etc/rc.d/rc.sysinit in Red Hat Linux. After the
execution of the scripts in /etc/rc.d/rc.sysinit, init starts to launch the processes associated
with the initial runlevel. At the end of execution of runlevel initial scripts, Linux will allow
you to log in.

Changing Runlevels at Boot Time

Under Red Hat Enterprise Linux, it is possible to change the default runlevel at boot time.

To change the runlevel of a single boot session, use the following instructions:

1. When the GRUB menu bypass screen appears at boot time, press any key to enter the GRUB menu
(within the first three seconds).
2. Press "e" key to append to the kernel command.

3. Add at the end of the boot options line to boot to the desired runlevel.
For example, the following entry would initiate a boot process into runlevel 3: