The Linux Boot Process

When you turn on the power to your Linux system, it triggers a series of events that eventually leads to the login prompt. Normally you don’t worry about what happens behind the scenes of those events; you just log in and start using your applications.

However, there may be times when your Linux system doesn’t boot quite correctly, or perhaps an application that you expected to be running in background mode isn’t. In those cases, it helps to have a basic understanding of just how Linux boots the operating system and starts programs so you can troubleshoot the problem.

Following the Boot Process

The Linux boot process can be split into three steps:

  1. The workstation firmware starts, performing a quick check of the hardware (called a power-on self-test [POST]), and then looks for a boot loader program to run from a bootable device.

  2. The boot loader runs and determines what Linux kernel program to load.

  3. The kernel program loads into memory and starts the necessary background programs required for the system to operate (such as a graphical desktop manager for desktops, or web and database servers for servers).

While on the surface these three steps may seem simple, there’s a somewhat complicated ballet of operations that happen behind the scenes to keep the boot process working. Each step performs several actions as they prepare your system to run Linux.

Viewing the Boot Process

You can monitor the Linux boot process by watching the system console screen as the system boots. You’ll see lots of informative messages scroll by as the system detects hardware and loads software.

Sometimes the boot messages scroll by somewhat quickly, and it’s hard to see just what’s happening. If you need to troubleshoot boot problems, you can review the boot time messages using the dmesg command. Most Linux distributions copy the boot kernel messages into a special ring buffer in memory, called the kernel ring buffer. The buffer is circular, and set to a predetermined size. As new messages are logged in the buffer, older messages are rotated out.

You use the dmesg command displays boot messages currently stored in the kernel ring buffer:

An output displays boot messages currently stored in the kernel ring buffer using the d m e s g command.
Description

An output displays boot messages currently stored in the kernel ring buffer using the d m e s g command.

Most Linux distributions also store the boot messages in a log file, usually in the /var/log folder.

While it helps to be able to see the different messages generated during boot time, it is also helpful to know just what generates those messages. This chapter discusses each of these three boot steps and goes through some examples showing just how they work.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.80.213