3.2 About the Boot Process

Understanding the Oracle Linux boot process can help you if you need to troubleshoot problems while booting a system. The boot process involves several files and errors in these files is the usual cause of boot problems.

When an Oracle Linux system boots, it performs the following operations:

  1. The computer's BIOS performs a power-on self-test (POST), and then locates and initializes any peripheral devices including the hard disk.

  2. The BIOS reads the Master Boot Record (MBR) into memory from the boot device. (For GUID Partition Table (GPT) disks, this MBR is the protective MBR on the first sector of the disk.) The MBR stores information about the organization of partitions on that device. On a computer with x86 architecture, the MBR occupies the first 512 bytes of the boot device. The first 446 bytes contain boot code that points to the boot loader program, which can be on the same device or on another device. The next 64 bytes contain the partition table. The final two bytes are the boot signature, which is used for error detection.

    The default boot loader program used on Oracle Linux is GRUB 2, which stands for GRand Unified Bootloader version 2.

  3. The boot loader loads the vmlinuz kernel image file into memory and extracts the contents of the initramfs image file into a temporary, memory-based file system (tmpfs).

  4. The kernel loads the driver modules from the initramfs file system that are needed to access the root file system.

  5. The kernel starts the systemd process with a process ID of 1 (PID 1). systemd is the ancestor of all processes on a system. systemd reads its configuration from files in the /etc/systemd directory. The /etc/systemd/system.conf file controls how systemd handles system initialization.

    systemd reads the file linked by /etc/systemd/system/default.target, for example /usr/lib/systemd/system/multi-user.target, to determine the default system target.

    Note

    You can use a kernel boot parameter to override the default system target. See Section 3.4, “Kernel Boot Parameters”.

    The system target file defines the services that systemd starts.

    systemd brings the system to the state defined by the system target, performing system initialization tasks such as:

    • Setting the host name.

    • Initializing the network.

    • Initializing SELinux based on its configuration.

    • Printing a welcome banner.

    • Initializing the system hardware based on kernel boot arguments.

    • Mounting the file systems, including virtual file systems such as the /proc file system.

    • Cleaning up directories in /var.

    • Starting swapping.

    See Section 3.7, “About System-State Targets”.

  6. If you have made /etc/rc.local executable and you have copied /usr/lib/systemd/system/rc-local.service to /etc/systemd/system, systemd runs any actions that you have defined in /etc/rc.local. However, the preferred way of running such local actions is to define your own systemd unit.

For information on systemd and on how to write systemd units, see the systemd(1), systemd-system.conf(5), and systemd.unit(5) manual pages.