Breaking

Linux Boot Process




 Linux Boot Process

Press the power button on your system, and after few moments you see the Linux login prompt. This process contains following Steps.


STEPS:

1. Power on


2. BIOS Initialization (Basic Input Output System)


It performs some integrity checks
It determines booting priority
It Prompts to select bootable device which can be Hard Disk, CD/DVD-ROM, Floppy Drive, USB Flash Memory Stick etc 
It collects device information  

3. POST - Power on Self Test


It performs error checking.
Fatal Errors - Occurs due to CPU,RAM,Hard Disk,Motherboard failure, It produces a beep sound
Non-Fatal Errors - Occurs due to keyboard or mouse failure, It displays error message, we can continue booting process


4. Boot Loader Initialization


Loads OS Kernel in to memory.

MBR (Master Boot Record)

It is the first sector of the Hard Disk with a size of 512 bytes.

This has three components 

1.Booting Info.   2.Partition Info.   3.Error Flag
-----------------            ----------------     -------------
   446 bytes             64 bytes          2 bytes



5. GRUB (GRand Unified Boot loader)


If you have multiple kernel images installed on your system, you can choose which one to be executed.

GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it loads the default kernel image as specified in the grub configuration file.

Grub configuration file is /boot/grub/grub.conf

LILO - Linux loader, It supports only single OS


6. Kernel


It mounts the root file system as specified in grub.conf 
Looks out for hard disk types be it a LVM or RAID
Unmounts initrd image and frees up all the memory occupied by the disk image

7. Init Process


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


# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
id:5:initdefault:

You can check current runlevel details of your system using below command on the terminal

# who -r
 
    

8. Runlevel scripts


A no.of runlevel scripts are defined inside /etc/rc.d/rcx.d

Runlevel  Directory

0 /etc/rc.d/rc0.d
1 /etc/rc.d/rc1.d
2 /etc/rc.d/rc2.d
3 /etc/rc.d/rc3.d
4 /etc/rc.d/rc4.d
5 /etc/rc.d/rc5.d
6 /etc/rc.d/rc6.d

Based on the selected runlevel, the init process then executes startup scripts located in subdirectories of the /etc/rc.d directory.

Scripts used for runlevels 0 to 6 are located in subdirectories /etc/rc.d/rc0.d to /etc/rc.d/rc6.d, respectivel

 9. Login Screen on your system



No comments:

Powered by Blogger.