10.boot Process For RHEL7
10.boot Process For RHEL7
Have you ever thought that what process executes as soon as we switch on our machine
and then to the login prompt?
As soon as we switch on our machine, it has no idea what to do, the first thing that
happens is Bios is loaded. Then Bios searches for MBR( First sector of the bootable
device) and BIOS handover control to it. MBR looks for boot-loader once boot
loader is loaded into memory it loads kernel and initramfs. After that file system is
mounted. Mother process gets executed the by kernel i.e init/ systemd and it runs
all the other required process and then login prompts comes.
The classical Basic Input Output System (BIOS), the Power-On Self-Test (POST) is
executed, and the hardware that is required to start the system is initialized.
2. MBR:
– Master Boot Record (MBR) is the first 512 bytes of the boot drive that is read
into memory by the BIOS.
– The next 64 bytes contain the partition table for the disk. The last two bytes are
the “Magic Number” which is used for error detection.
– MBR discovers the bootable device and loads the GRUB2 boot loader into
memory and transfers control over to it.
# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/swap crashkernel=auto
rd.lvm.lv=rhel/root rhgb quiet net.ifnames=0"
GRUB_DISABLE_RECOVERY="true"
– GRUB2 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 initial RAM disk (initrd) is an initial root file system that is mounted before
the real root file system.
9.Booting Process for RHEL7
initramfs
– 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 kernel and the kernel mounts this initramfs as part
of a two-stage boot process.
– The dracut utility creates initramfs whenever a new kernel is installed.
– Use the lsinitrd command to view the contents of the image created by dracut:
# lsinitrd | less
4. Loading the kernel
– The kernel starts the systemd process with a process ID of 1 (PID 1).
– The kernel starts the systemd process with a process ID of 1 (PID 1).
Use the following command to view which target unit is used by default:
# systemctl get-default
graphical.target
The graphical.target target unit indicates that the system is running in a graphical,
multi- user state. This is similar to run level 5 in a SysV init system. You can verify
this using the old command runlevel :
9.Booting Process for RHEL7
# runlevel
N5
Linux O.S has Six Run Levels:---