0% found this document useful (0 votes)
57 views7 pages

10.boot Process For RHEL7

1. When a machine is powered on, the BIOS loads and performs hardware checks. It then loads the MBR which finds and loads the boot loader GRUB2. 2. GRUB2 loads the kernel and initramfs into memory. The initramfs contains drivers needed to access devices and mount the root file system. 3. The kernel starts systemd as the first process which reads configuration files to determine the target state, such as graphical mode. Services are started to launch the login prompt.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views7 pages

10.boot Process For RHEL7

1. When a machine is powered on, the BIOS loads and performs hardware checks. It then loads the MBR which finds and loads the boot loader GRUB2. 2. GRUB2 loads the kernel and initramfs into memory. The initramfs contains drivers needed to access devices and mount the root file system. 3. The kernel starts systemd as the first process which reads configuration files to determine the target state, such as graphical mode. Services are started to launch the login prompt.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

9.

Booting 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.

Diagram1 for RHEL7 Booting process

Diagram2 for RHEL standard Booting process


9.Booting Process for RHEL7

Diagram3 for RHEL standard Booting process


9.Booting Process for RHEL7

1. POST (Power on Self Test)

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.

1. Primary Boot Loader in Linux.


2. Partition table is about Hard disk information attached to the machine.
3. MBR validation check.
 MBR job is to look for boot loader and hand over control to it.

3. Loading the boot loader:


9.Booting Process for RHEL7

– The default bootloader program used on RHEL 7 is GRUB 2. GRUB stands


for GRand Unified Bootloader. GRUB 2 replaces the older GRUB bootloader also
called as legacy GRUB.
– The GRUB 2 configuration file is located at /boot/grub2/grub.cfg (Do not edit
this file directly).

– GRUB 2 menu-configuration settings are taken from /etc/default/grub when


generating grub.cfg.
– Sample /etc/default/grub file :

# 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).

– It also loads the necessary driver modules from initrd image.


– The boot loader (GRUB2) may present a boot menu to the user, or can be
configured to automatically start a default operating system.
– To load Linux, the kernel is loaded together with the initramfs. The initramfs
contains kernel modules for all hardware that is required to boot, as well as the
initial scripts required to proceed to the next stage of booting.
– On RHEL 7, the initramfs contains a complete operational system (which may be
used for troubleshooting purposes).

5. Starting system or Run levels

– The kernel starts the systemd process with a process ID of 1 (PID 1).

– systemd reads the file linked by /etc/systemd/system/default.target (for


example, /usr/lib/systemd/system/multi-user.target) to determine the default
system target (equivalent to run level). The system target file defines the services
that systemd starts.
– systemd allows you to manage various types of units on a system, including
9.Booting Process for RHEL7

services (name.service) and targets (name.target), devices (name.device), file


system mount points (name.mount), and sockets (name.socket).

Run Levels and Target Units

Run Level Target Units Description

0 runlevel0.target, poweroff.target Shut down and power off

1 runlevel1.target, rescue.target Set up a rescue shell

2,3,4 runlevel[234].target, multi- user.target Set up a nongraphical multi-us

5 runlevel5.target, graphical.target Set up a graphical multi-user s

6 runlevel6.target, reboot.target Shut down and reboot the sys

View default/current target unit

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:---

Run Level Run Level Description


0 Halt / Shutdown
1 Single-user mode
2 Not used (user-definable)
3 Full multi-user mode (no GUI interface) CLI only
4 Not used (user-definable)
5 Full multiuser mode (with GUI interface)
6 Reboot

You might also like