From the course: Linux: Kernels and Logging for System Administration

Understanding the Linux boot process - Linux Tutorial

From the course: Linux: Kernels and Logging for System Administration

Start my 1-month free trial

Understanding the Linux boot process

- [Instructor] From Chapter Two on, all exercises will be done inside one or more CentOS 7 virtual machines. If you were not able to install CentOS 7 on a physical computer, you can start here with CentOS 7 installed on a VirtualBox virtual machine, running on any host operating system. A Linux system goes through several stages when booting, the firmware stage, the boot loader stage, the kernel stage and lastly, the initialization stage. During the firmware stage, the computer runs code in either the BIOS or UEFI during power-on self-test, or POST. Older computers have a BIOS and newer computers have UEFI. After the firmware stage, the BIOS or UEFI executes the boot loader stage. In the case of Enterprise Linux, the boot loader is grub2, or grand unified boot loader 2. Grub's job is to read in its configuration file and boot the Linux kernel. In the case of a BIOS machine, grub reads in /boot/grub2/grub.cfg. For UEFI systems, it loads /boot/efi/EFI/redhat/grub.efi. The boot loader then executes the kernel. During the kernel stage, the kernel loads the ramdisk into memory. This ramdisk serves as a temporary root file system. This file system includes kernel modules, drivers and possibly even kickstart files. Later, the kernel unmounts the ramdisk and mounts the root filesystem on the hard drive, and then starts the initialization stage by executing the first process. In the initialization stage, the grandfather process runs. In older versions of Red Hat, this was the init process. Init was replaced by upstart, which has now been replaced by systemd. Systemd then starts all system services. Included would be a login shell or a graphical interface. When it's finished, the OS is ready to be used. Systemd has a concept of targets that are similar to the old init run levels. You can think of a target as a system configuration. For instance, by default, Enterprise Linux boots up into the graphical target. A system can be booted into different targets. There are targets for different purposes, such as rescuing the system after a crash.

Contents