0% found this document useful (0 votes)
73 views

Booting Process and Issues

The document discusses common issues that can occur during the booting process and provides solutions. It describes the typical boot sequence: 1) BIOS performs POST and loads MBR, 2) MBR loads GRUB boot loader, 3) GRUB loads kernel and initramfs into RAM, 4) kernel mounts root file system and executes init process, 5) systemd starts system services and targets. Potential issues include problems with swap partition, corrupted initramfs, GRUB errors, GRUB configuration issues, and corrupted MBR. The solutions involve checking log files, recreating swap, repairing initramfs, reinstalling GRUB, and reloading the MBR from rescue mode.
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)
73 views

Booting Process and Issues

The document discusses common issues that can occur during the booting process and provides solutions. It describes the typical boot sequence: 1) BIOS performs POST and loads MBR, 2) MBR loads GRUB boot loader, 3) GRUB loads kernel and initramfs into RAM, 4) kernel mounts root file system and executes init process, 5) systemd starts system services and targets. Potential issues include problems with swap partition, corrupted initramfs, GRUB errors, GRUB configuration issues, and corrupted MBR. The solutions involve checking log files, recreating swap, repairing initramfs, reinstalling GRUB, and reloading the MBR from rescue mode.
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/ 6

ALC LABS QUESTIONS

1. Booting Process:
Ans:
1) Power on
2) BIOS (Basic Input Output Systems)

 BIOS refers to Basic Input Output system, performs the


POST(power on self Test) to detect, test and initialize system
hardware components.
 Load the MBR (Master Boot Record)
 If some hardware broke, system will notice.
 Once the boot loader program is detected and loaded into the
memory, BIOS gives the control to it.
 In simple terms “BIOS loads and executes the MBR
boot loader”
3) MBR (Master Boot Record)

 MBR is the first sector of the disk. Its first 512 bytes of the
“boot drive” is read into memory by the BIOS.
 Out of 512 bytes, first 446 bytes is “data of boot loader”, 64
bytes contains the “partition table” for the disk and the last 2
bytes are the “magic number” which is used for error
deduction in sector.
 MBR discover and loads GRUB2 boot loader into memory
and transfers control over to it (This know as GRUB stage
1.5).
 In simple terms “MBR loads and executes the GRUB2
boot loader”.
4) GRUB2 (Grand Unified Boot Loader)

 GRUB2 is default boot loader program in RHEL7. This


replaces the older version GRUB boot loader.
 GRUB2 have configuration file
“/boot/grub2/grub.cfg”(don’t edit this file directly).
 GRUB2 menu configuration settings are taken from
“/etc/default/grub” when generating “grub.cfg”.
using “grub2-mkconfig “ command.
 GRUB2 searches the compressed kernel image file vmlinuz
in /boot directory and load into memory.
 GRUB2 extract the content of “initramfs” image into a
temporary memory base file system(tmpfs), also know as
the RAM file system or RAM Disk.
 The initial RAM disk is an initial file system that is mounted
before the read root file system (/).
 In simple terms “GRUB2 loads and executes kernel,
‘initramfs’ is extracted into the RAM disk and gives
control to kernel”.
5) kernel

 Kernel mounts the root file system and executes /sbin/init


(soft linked with systemd in RHEL7)
 since systemd is the first program to be executed by linux
kernel, and its pid is 1.
6) Systemd

 systemd is the parent of all processes on the system.


 systemd reads the file linked by
“/etc/systemd/system/default.target” to determine
the default system target(Equalent to runlevel)
 The system target file defines the services that systemd
starts and performs system initialization such as
1. Setting hostname
2. Network initialization
3. SElinux initialization
4. System hardware initialization
5. Mounting file systems, including virtual file system
such as /proc (uptime, vmstat, cpuinfo, swaps,
devices, filesystems, modules,keys).
6. Starting swap space etc..
2. Issues in booting server?
Ans: /var/log/boot.log  log system boot message.(first file
we need to check)
Issue:
1. Problem with swap partition; the system either failed to read
the swap file . Check the system is using swap space with #free
command (or) alternatively #swapon –s command (we wont get
any out put).
- resolve this issue by creating new swap space.
2.Problem with “initramfs” file you will find init not found error
Error : "init not found" displayed
-To resolve boot the system in to the Rescue Mode from there I
will try to repair the initramfs.
-Here we have to select “Rescue installed
system”(language,keyboard,Rescue,Setupnetworking)
-Select Rescue
-choose ok for ShellStart
#bash-4.1:df –h
Output: All FS will be mounted under /mnt/sysimage
#chroot /mnt/sysimage —change to root environment
Sh-4.1#df –h
#cd /boot
#dracut –f initramfs-$(uname –r).img
#exit –come out from root shell
Bash-4.1#reboot —boot ur system again

3. problem with GRUB, you will see GRUB error.


 In rescue mode.

   #  chroot /mnt/sysimage
   # /sbin/grub-install /dev/hda
- to fix: re-install GRUB & try to start your system by manual
entering GRUB in command line.
4. problem with GRUB config file also makes you unable to
reboot
--System will take you to grub prompt while rebooting
grub>kernel /vmlinuz.img –Just cross check kernel
>kernel /vmlinuz.img root=/dev/sda2
>initrd /initramfs.img
>boot
>reboot (system will be boot with help of CD drive)
Bash-4.1#df –h
#cat /mnt/sysimage/etc/fstab
#blkid |grep –I sda In this case there is no /var, /boot,
/tmp so we nedd to mount manually
#mount /dev/sda1 /mnt/sysimage/boot
#mount /dev/sda5 /mnt/sysimage/home
#mount /dev/sda7 /mnt/sysimage/tmp
#mount /dev/sda3 /mnt/sysimage/var
#cd /mnt/sysimage/boot
#ls –ltr
#cd grub2
#ls -ltr
5. problem with MBR or mbr corrupted server will go to rescue
mode
Go to the Rescue mode to reload the MBR
Bash-4.1#df –h
#chroot /mnt/sysimage
Sh-4.1#df –h
#grub-install /dev/sda -To Recover MBR
#exit- -come out from root shell
Bash-4.1#reboot

You might also like