Skip to main content

BOOT PROCESS

                                                  BOOT PROCESS 





*The following are the 6 high level stages of a typical Linux boot process.

1. BIOS

BIOS stands for Basic Input/Output System. In simple terms, the BIOS loads and executes the Master Boot Record (MBR) boot loader.

When you first turn on your computer, the BIOS first performs some integrity checks of the HDD or SSD.

Then, the BIOS searches for, loads, and executes the boot loader program, which can be found in the Master Boot Record (MBR). The MBR is sometimes on a USB stick or CD-ROM such as with a live installation of Linux.

Once the boot loader program is detected, it's then loaded into memory and the BIOS gives control of the system to it.


2. MBR

    MBR stands for Master Boot Record.It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda

    MBR is less than 512 bytes in size. This has three components 1) primary boot loader info in 1st 446 bytes 2) partition table info in next 64 bytes 3) mbr validation check in last 2 bytes.

    It contains information about GRUB (or LILO in old systems).

    So, in simple terms MBR loads and executes the GRUB boot loader


3. GRUB

As mention above the term GRUB stands for “Grand unified boot loader” , if we have multiple images installed on our system we can choose one to be execute, GRUB display a splash screen, waits for few seconds, if you don’t enter or press anything, it loads the default Kernel image as specified in the GRUB Configuration file,

Configuration files:/boot/grub/grub.conf  "it is link with" /etc/grub.conf    
- in Red Hat Linux/boot/grub/grub.cfg  "it is link with" /etc/default/grub 


4. Kernel

The kernel is often referred to as the core of any operating system, Linux included. It has complete control over everything in your system.

In this stage of the boot process, the kernel that was selected by GRUB first mounts the root file system that's specified in the grub.conf file. Then it executes the /sbin/initprogram, which is always the first program to be executed. You can confirm this with its process id (PID), which should always be 1.

The kernel then establishes a temporary root file system using Initial RAM Disk (initrd) until the real file system is mounted.

5. Init

  • Looks at the /etc/inittab file to decide the Linux run level.

  • Following are the available run levels

    • 0 – halt

    • 1 – Single user mode

    • 2 – Multiuser, without NFS

    • 3 – Full multiuser mode

    • 4 – unused

    • 5 – X11

    • 6 – reboot

  • Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program.

  • Execute ‘grep initdefault /etc/inittab’ on your system to identify the default run level

  • If you want to get into trouble, you can set the default run level to 0 or 6. Since you know what 0 and 6 means, probably you might not do that.

  • Typically you would set the default run level to either 3 or 5.


6. Runlevel programs

When the Linux System booting up, Those are the run level programs execute from the run level directory or defined by your run level directory.

Under the /etc/rc.d/rc*.d / directories, you would see program that start with S & K.

Program start with S are used during startup S for startup, K for kill.


Comments

Popular posts from this blog

Difference between Linux and Window.

  Following are the important differences between Linux and Windows. Sr. No. Linux Windows 1 Linux is Open Source and is free to use. Windows is not open source and is not free to use. 2 There are no drives in Linux Windows has different drives like C: D: E 3 For every user /home/username directory is created which is called his home directory. In windows, My Documents is default home directory. 4 More secure Vulnerable to viruses and malware attacks. 5 Linux file system is case sensitive. Windows file system is case insensitive. ...

Introduction of Linux

  What Is Linux? Just like Windows, iOS, and Mac OS, Linux is an operating system. In fact, one of the most popular platforms on the planet, Android, is powered by the Linux operating system. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. Linux is a free and open source software, which means that you can use, copy, study, and change the software in any way. It is distributed with the source code so users can view and modify it. This is in contrast to Microsoft Windows, a proprietary operating system. How was Linux created? Linux was created in 1991 by Linus Torvalds, a then-student at the University of Helsinki. Torvalds built Linux as a free and open source alternative to Minix, another Unix clone that was predominantly used in academic settings. He originally intended to name it “Freax,” but the administrator of the server Torvalds used to distribute the original code named his directory “Linux” after a comb...