Hello and welcome to this video on the Boot Process in Oracle Linux 8.
This video is the first in a series of videos, each of which describe different aspects of
the boot process.
This video describes the high-level steps of the boot process in Basic Input/Output
System, or BIOS mode.
Other videos in this series will describe Unified Extensible Firmware Interface, or
UEFI, which is a newer method for booting systems.
For our objectives today, after viewing this video, you should be able to:
Describe the high-level steps in the BIOS firmware bootloader process.
Describe the Master Boot Record for the bootloader.
Describe the GRUB2 bootloader.
Explain the two-stage boot process.
Describe the vmlinuz kernel image and the initial RAM disk files.
Describe the purpose of the systemd process.
The slide begins to describe the high-level steps of the BIOS firmware bootloader process.
Understanding the Linux boot process is helpful when attempting to troubleshoot boot problems.
You need to be aware of the files involved in the boot process because errors in these
files can cause boot problems.
After powering on your computer, the BIOS firmware performs power-on-self-test, or POST.
The BIOS then reads the Master Boot Record, or MBR, for the bootloader.
On a computer with x86 architecture, the Master Boot Record is the first 512 bytes of the
boot partition that is read into memory by the BIOS.
The first 446 bytes of that 512 bytes contain low-level boot code.
For some bootloaders, the code in the MBR points to further bootloader code somewhere
else on the disk or on another disk.
The next 64 bytes contain the partition table for the disk.
The last two bytes are the boot signature, which is used for error detection.
The bootloader software runs when a computer starts.
It is responsible for loading and transferring control to the kernel.
The kernel then initializes the rest of the operating system.
Many bootloaders are available.
The most common bootloaders for Linux are LILO, which stands for LInux LOader, and GRUB,
or the GRand Unified Bootloader.
The default bootloader used on Oracle Linux 8 is GRUB 2.
Continuing on with the high-level steps in the BIOS firmware bootloader process,
the GRUB2 bootloader 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.
The kernel mounts this initramfs as part of a two-stage boot process.
The initial RAM disk (initramfs) is an initial root file system that is mounted before the
real root file system.
The job of the initial RAM file system is to preload the block device modules, such
as for IDE, SCSI, or RAID, so that the root file system on which those
modules normally reside can then be accessed and mounted.
The initramfs is bound to the vmlinuz kernel image.
For example, if the kernel version is 5.4.17, there is a vmlinuz file and an initramfs file
containing the same version number.
Both the vmlinuz kernel image file and the initial RAM disk initramfs file are located
in the /boot directory.
To show the locations of the vmlinuz kernel image file and the initial RAM disk initramfs
file, I'll begin by viewing the partition table for the devices on my system.
Notice the primary boot disk for this system is /dev/sda, which has two partitions, sda1
and sda2. /dev/sda1 is the boot partition and is designated
by the column with the asterisk.
I can then show that /dev/sda1 is mounted on /boot.
Finally, if I list the contents of the /boot directory, I see initramfs and vmlinuz entries.
This shows that three kernels have been installed: The Oracle Unbreakable Enterprise Kernel,
or the UEK, the Red Hat Compatible Kernel, and the rescue kernel.
The rescue kernel boots a Red Hat Compatible Kernel with a known good initramfs.
If your system does not boot with the desired kernel, you can boot the rescue kernel and
correct the problem.
Another use case for the rescue kernel is booting the system with different hardware,
such as when the disk is being accessed remotely or has been physically moved between systems.
After the newly loaded kernel gets far enough along in its initialization sequence (disks
probed, memory is mapped, and so on), it then switches over to using the real root
file system as specified by the root directive in the GRUB 2 configuration.
This GRUB2 configuration file contains, among other things, the /etc/fstab file identifying
the rest of the file systems to be mounted.
The kernel then starts the systemd process with a process ID of 1.
systemd is the ancestor of all processes on a system.
systemd reads its configuration files which controls how systemd handles system initialization.
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 upon its configuration, 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, and many other things.
Oracle provides an extensive number of resources which you can use to learn more about this
subject and others.
Look for additional videos on the Oracle Linux 8 boot process covering GRUB2, systemd, kernel
boot parameters, the UEFI boot method, and other Linux boot process topics.
This concludes this presentation.
Thank you for watching.