Linux Boot Process

Given below is the summary of the above video:
  1. After pressing the power button, the Linux system goes through the following 6 high-level stages:
b) MBR
d) Kernel
e) Init
f) Runlevel

  1. BIOS (Basic Input Output System) performs system integrity checks and loads the MBR bootloader in the memory(RAM).

  1. MBR (Master Boot Record) is less than 512 bytes in size. It is located in the first sector of the bootable disk(usually /dev/hda or /dev/sda). Basically MBR loads and executes GRUB.

  1. GRUB (Grand Unified Bootloader) can choose the exact kernel you want to load in case there are multiple images installed. Configuration file is at /boot/grub/grub.conf. Basically GRUB just loads the kernel and initial RAM disk images(Init rd). It is used by the kernel as a temporary root file system until the real root file system is mounted by the kernel.

  1. The kernel mounts the root file system as specified in the grub configuration file. Kernel also executes the init process(the first process with process id 1) located at /sbin/init.

  1. Init looks at /etc/inittab file to decide the Linux run level.

  1. Run level decides which programs will be loaded at startup. There are 7 run levels(halt, single-user mode, multiuser-without NFS, full multiuser mode, unused, X11 and reboot) each having a directory at /etc/rc.d/ In these directories, some program names start with S which means they will be run during startup and some names start with K which means they will be killed at shutdown. There are numbers in their names which determine the sequence in which these programs are started or killed.