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
orUEFI
during power on self test or post. - Older computers have a
BIOS
and 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
ramdisk
into memory. - This
ramdisk
serves as a temporary root file system, includeskernel
modules
,drivers
, and possibly evenkickstart
files. - Later, the kernel unmounts the
ramdisk
and 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
Init
process. Init was replaced byUpstart
, which has now been replaced bysystemd
. 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 oldInit
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.