Linux - Linux Boot Process
linux boot process
A Linux system goes through several stages when booting.
the firmware stage
- the computer runs code in
BIOSorUEFIduring power on self test or post. - Older computers have a
BIOSand newer computers haveUEFI.
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.
- For BIOS machine, grub reads in
- The boot loader then executes the kernel.
the kernel stage
- the kernel loads a
ramdiskinto memory. - This
ramdiskserves as a temporary root file system, includeskernelmodules,drivers, and possibly evenkickstartfiles. - Later, the kernel unmounts the
ramdiskand mounts theroot 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
Initprocess. Init was replaced byUpstart, which has now been replaced bysystemd. Systemdthen starts all system services, a login shell or a graphical interface.- When it’s finished, the OS is ready to be used.
Systemdhas the concept of Targets that similar to the oldInitrun 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.