0% found this document useful (0 votes)
23 views10 pages

Linux Booting Process 1741417781

The document outlines the booting process of Red Hat Linux 7/8, detailing the six high-level stages: BIOS, MBR, GRUB, Kernel, Init, and Runlevels. It explains the roles of each component in the boot process, including the differences between init and systemd, and provides insights into filesystem hierarchy and troubleshooting methods. Additionally, it covers topics such as Secure Boot, PXE booting, and dual-boot configurations with Windows.

Uploaded by

Pavan k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views10 pages

Linux Booting Process 1741417781

The document outlines the booting process of Red Hat Linux 7/8, detailing the six high-level stages: BIOS, MBR, GRUB, Kernel, Init, and Runlevels. It explains the roles of each component in the boot process, including the differences between init and systemd, and provides insights into filesystem hierarchy and troubleshooting methods. Additionally, it covers topics such as Secure Boot, PXE booting, and dual-boot configurations with Windows.

Uploaded by

Pavan k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

RED-HAT LINUX 7/8

Trained By: PV Narayana


Contact: +91-9535500796

Booting Process

Power the server behind running the 6 high level stages

1.BIOS
2.MBR
3.Grub
4.Kernel
5.init
6.runlevel

1.Bios (Basic input output system)

--> Its run POST (power on self-test),


--> It performs to system integrity checks.
--> Identifies and initializes bootable devices.
--> it performs to check all devices getting proper voltage or not.
--> It displays the system function like keyboard, mouse, etc....
--> once the bootloader(grub) program detected and loaded into the memory and
execute the MBR

2.MBR (Master boot record)

--> This is the first sector of the bootable disk. typically located in /dev/sda, /dev/vda
--> This is max of 512 Bytes of the Disk

There are 3 components

Primary boot loader --> 446 bytes


Patrion table info --> 64 bytes
Validation Checking --> 2 bytes

Once MBR is loaded and execute the grub boot loader.


RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796

3. Grub (Grand unified boot loader)

--> If you have multiple kernel images installed in your system you can choose which one
To be executed.
--> Grub displays the splash screen, wait for few seconds, if don't enter anything
loads default.
--> Grub has knowledge on filesystem,
--> Configuration file /boot/grub/grub.conf or /boot/grub2/grub.cfg
cat /boot/grub2/grub.cfg -→ Rhel 7
--> Once grub is loaded execute the kernel.
4. Kernel

--> Mount the root filesystem as specified in the "root"


--> Kernel execute the /sbin/init program.
--> initrd stands for initial ram disk it is used by kernel.
--> Initrd is used temporray root filesystem untill the kernel is booted and the real root
filesystem mounted

5. Init

Configuration file /etc/inittab to detect the run levels

init 0 --> shutdown


init 1 --> single user mode
init 2 --> Multi user mode without nfs(Network file sharing)
init 3 --> multi user mode with NFS

init 4 --> future Purpose


init 5 --> GUI (Graphical user interface)
init 6 --->Reboot

6. Runlevels

--> when linux is booting up will see various services are getting started.
--> Default init runlevel value 0

/etc/rc.d/rc1.d

rc---> Run control


#who -r ---> check the run lvel
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796

#cat /etc/grub.conf or
#cat /boot/grub/grub.conf

or
cat /boot/grub2/grub.cfg > Rhel 7
#uname -a > Server arch mode

#uname -r --> Kernel version

Basic Questions
1. What is the first process that runs after the kernel is loaded?
o RHEL 6: init (SysVinit)
o RHEL 7: systemd

2. What is the role of GRUB in Linux booting?


• GRUB is the bootloader that loads the kernel and initramfs into memory and passes
control to the kernel.
3.What is the difference between init and systemd?
• init (RHEL 6) uses sequential service startup, while systemd (RHEL 7) uses parallel
service startup for faster boot times.
4. Where is the GRUB configuration file located?
• GRUB Legacy (RHEL 6): /boot/grub/grub.conf
• GRUB2 (RHEL 7): /boot/grub2/grub.cfg
5. What is initramfs, and why is it important?
• initramfs is a temporary filesystem used to load necessary drivers and mount the
root filesystem.

6.How do you recover a system with a corrupted GRUB?


• Boot into rescue mode using a bootable media and reinstall GRUB using:

grub2-install /dev/sdX
grub2-mkconfig -o /boot/grub2/grub.cfg
[root@localhost grub2]# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"

PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)"


ANSI_COLOR="0;31"
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796

Going to the single user mode and reset the root password

=============================================================

FILESYSTEM HIERARCHY SYSTEM

/ --> This is top level directory


This is parent directory all directories under /
called as root directory
/root --> this is default root home directory
/home ---> This is default home directory of other users
/usr ---> this is default softwares installed in
this directory
/opt ---> this is 3rd party softwares
installed in this directory
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796
/etc --> all configuration files located here.
/bin --> all binary files located and execut the
all commands all users
/sbin --> system binary files, execute the
super user (root) commands
/lib --> libary files stored in this dir
/media --> Meadi files stord in this dir
ex: USB,flopydisk
/tmp --> Tempory files stored in this dir
/var ---> varible files stored ex log files and mails
/mnt --> mounted files stored in this dir
/dev --> Contains the device files
/proc --> Process files stored in this directory

1. What is the Linux boot process?


The Linux boot process refers to the sequence of steps the system undergoes
to start the operating system, from powering on the hardware to loading the
OS and providing a user environment.
2. Can you explain the stages of the Linux boot process?
The Linux boot process consists of the following stages:
1. BIOS/UEFI Initialization:
o Performs Power-On Self-Test (POST).
o Locates the bootloader in the MBR or EFI partition.
2. Bootloader (e.g., GRUB):
o Loads the kernel and initramfs into memory.
o Passes control to the kernel.
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796
3. Kernel Initialization:
o Initializes hardware (drivers, memory).
o Mounts the root filesystem.
o Executes the init process (or systemd).
4. Initramfs/Initrd:
o Provides a temporary root filesystem to prepare for mounting the
actual root filesystem.
5. System Initialization (Init/Systemd):
o Manages system initialization, including services, targets, and
runlevels.
6. Login Prompt:
o Provides the user interface (GUI/CLI) for user interaction.

3. What is the role of the BIOS/UEFI during the boot process?


• BIOS:
o Performs hardware initialization through POST.
o Finds the bootloader in the Master Boot Record (MBR) of the
bootable disk.
• UEFI:
o Similar to BIOS but supports modern features like Secure Boot.
o Looks for bootloaders in the EFI System Partition (ESP).
4. What is the bootloader, and what are its types?
• The bootloader is a program that loads the operating system kernel into
memory.
• Popular bootloaders include:
o GRUB (GRUB2): Commonly used in Linux.
o LILO: Legacy bootloader, rarely used now.
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796
o SYSLINUX: Used for live systems.

5. What is the role of initramfs/initrd in the boot process?


• Initramfs/Initrd:
o Acts as a temporary root filesystem.
o Loads necessary modules and drivers to prepare the system for
mounting the actual root filesystem.
o Particularly useful for systems using RAID, LVM, or encrypted
filesystems.

6. What is the difference between GRUB and GRUB2?


• GRUB:
o Legacy bootloader with fewer features.
o Configuration is manual and more limited.
• GRUB2:
o Modern bootloader with dynamic module loading.
o Supports multiple filesystems, GPT, and UEFI.
o Configuration files: /etc/default/grub, /boot/grub/grub.cfg.

7. What is the role of the kernel in the boot process?


The kernel:
• Initializes the system’s hardware.
• Loads device drivers.
• Mounts the root filesystem.
• Transfers control to the init process (/sbin/init or systemd).
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796

8. What is the difference between init and systemd?


• Init:
o Legacy initialization system.
o Sequentially starts services based on runlevels.
• Systemd:
o Modern initialization system.
o Parallelizes service startup, uses targets instead of runlevels.
o Configuration: /etc/systemd/system.

9. What happens during the kernel panic?


A kernel panic occurs when:
• The kernel encounters a fatal error it cannot recover from.
• Causes:
o Corrupted filesystem.
o Missing kernel modules.
o Misconfigured bootloader.
• To debug: Use logs from /var/log.
10. What is PXE booting?
• PXE (Preboot Execution Environment):
o Boots a system over the network.
o Used in environments where deploying an OS on multiple systems
is required.
o Works with TFTP and DHCP to load the bootloader and kernel over
the network.
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796
11. How do you troubleshoot a Linux system that won’t boot?
• Steps:
1. Check for hardware issues (BIOS/UEFI POST).
2. Use recovery mode or live CD to access the system.
3. Verify bootloader configuration (GRUB).
4. Check the kernel and initramfs.
5. Review logs: /var/log/messages, /var/log/dmesg.
6. Repair the filesystem using fsck.
12. How do you rebuild the initramfs?
• Command:
#sudo dracut -f
or
#sudo mkinitcpio -p linux

13. How do you update GRUB configuration?


1. Modify /etc/default/grub.
2. Update the GRUB configuration:
#sudo update-grub
#sudo grub2-mkconfig -o /boot/grub2/grub.cfg

14. What is a runlevel, and how is it managed in Linux?


• Runlevel: Defines the state of the machine (e.g., single-user mode,
multi-user mode).
• Systemd equivalent: Targets (e.g., multi-user.target).
• View current runlevel:
#runlevel
RED-HAT LINUX 7/8
Trained By: PV Narayana
Contact: +91-9535500796

#systemctl set-default multi-user.target

15. What is Secure Boot, and how does it affect Linux booting?
• Secure Boot:
o A UEFI feature that prevents unsigned or untrusted OS/kernel
from booting.
o Linux distributions like Ubuntu and Fedora support Secure Boot
through signed bootloaders.
16. How do you configure a dual-boot system with Linux and Windows?
1. Install Windows first (if not already installed).
2. Install Linux, ensuring GRUB is installed in the correct location.
3. GRUB will detect Windows and add it to the boot menu.
4. Update GRUB configuration after installation:
#sudo update-grub

You might also like