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/init
program,
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
Post a Comment