Linux Introduction
VI-EDITOR
Process Management
Linux Installation
Disk Partitions & File System Management
Logical Volume Management - LVM
User & Group Administration
Package Management
Network File System - NFS
Domain Naming System - DNS
Apache HTTP Web Server
KickStart Installations
FTP server
BOOT PROCESS
Dynamic Host Configuration Protocol - DHCP
Job Scheduling
File Links
Swap Management
Log Management
Performance Management
Linux Troubleshooting
Linux Summary
116 Followers
Boot Process Stages:
Below are the different Stages involved in Linux Boot Process:
BIOS is the first core program what loads when the server is powered on. When server gets powered on then CPU looks out into ROM for further instruction.
Boot Loader
At this stage Boot Loader will be loaded (MBR and GRUB/LILO) into memory to bring up the kernel.
MBR (Master Boot Record)
MBR is the first sector of the Hard Disk with a size of 512 bytes.
The first 434 - 446 bytes are the primary boot loader, 64 bytes for partition table and 6 bytes for MBR validation timestamp.
MBR directly cannot load the kernel as it is unaware of the filesystem concept and requires a boot loader with file system driver for each supported file systems, so that they can be understood and accessed by the boot loader itself.
To overcome this situation GRUB is used with the details of the filesystem in /boot/grub.conf and file system drivers
GRUB (GRand Unified Boot loader)
GRUB loads the kernel in 3 stages
GRUB Stage 1:
The primary boot loader takes up less than 512 bytes of disk space in the MBR - too small a space to contain the instructions necessary to load a complex operating system.
Instead the primary boot loader performs the function of loading either the stage 1.5 or stage 2 boot loader.
GRUB Stage 1.5:
GRUB Stage 2:
Stage 2 is responsible for loading kernel from /boot/grub/grub.conf and any other modules needed
Loads a GUI interface i.e. splash image located at /grub/splash.xpm.gz with list of available kernels where you can manually select the kernel or else after the default timeout value the selected kernel will boot
The original file is /etc/grub.conf of which you can observe a symlink file at /boot/grub/grub.conf
Sample /boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-194.26.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.26.1.el5 ro root=/dev/VolGroup00/root clocksource=acpi_pm divisor=10
initrd /initrd-2.6.18-194.26.1.el5.img
title Red Hat Enterprise Linux Server (2.6.18-194.11.4.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.11.4.el5 ro root=/dev/VolGroup00/root clocksource=acpi_pm divisor=10
initrd /initrd-2.6.18-194.11.4.el5.img
title Red Hat Enterprise Linux Server (2.6.18-194.11.3.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.11.3.el5 ro root=/dev/VolGroup00/root clocksource=acpi_pm divisor=10
initrd /initrd-2.6.18-194.11.3.el5.imgKernel is the heart of operating system responsible for handling all system processes.
Kernel is loaded in the following stages:
Executes the system to boot into the run level as specified in /etc/inittab
Sample output defining the default boot runlevel inside /etc/inittab
# 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:As per above O/P system will boot into runlevel 5
You can check current runlevel details of your system using below command on the terminal
# who -r
run-level 3 Jan 28 23:29 last=SNext as per the fstab entry file system's integrity is checked and root partition is re-mounted as read-write (earlier it was mounted as read-only).
Runlevel Scripts are defined inside /etc/rc.d/rcx.d
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.
Lastly, init runs whatever it finds in /etc/rc.d/rc.local (regardless of run level). rc.local is rather special in that it is executed every time that you change run levels.
Next if everything goes fine you should be able to see the Login Screen on your system.