Post

Linux - Linux Boot Process

linux boot process

A Linux system goes through several stages when booting.

the firmware stage

  • the computer runs code in BIOS or UEFI during power on self test or post.
  • Older computers have a BIOS and newer computers have UEFI.

the boot loader stage

  • After the firmware stage, the BIOS or UEFI executes the boot loader stage.
  • the boot loader is grub2, or grand unified boot loader two.
  • Grub’s job is to read configuration file and boot the Linux kernel
    • For 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.

the kernel stage

  • the kernel loads a ramdisk into memory.
  • This ramdisk serves as a temporary root file system, includes kernel modules, drivers, and possibly even kickstart files.
  • Later, the kernel unmounts the ramdisk and mounts the root file system on the hard drive.
  • And then, starts the initialization stage by executing the first process.

the initialization stage

  • 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, a login shell or a graphical interface.
  • When it’s finished, the OS is ready to be used.
  • Systemd has the concept of Targets that similar to the old Init run levels. You can think of a target as a system configuration.
    • default, boots up into the graphical.target.
  • A system can be booted into different Targets for different purposes, such as rescuing the system after a crash.
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.