Boot
Process (RHEL7 & 6)
Booting is the process
of to load OS from computers hard disk to primary memory (RAM).
Step 1: Power ON
When you press on power on button SMPS (switch mode power
supply) will get an signal to power on, immediate after it PGS (Power on boot
signal) will execute to get power to all components.
Step 2: POST
(Power-on-Self-Test) is diagnostic testing sequence all the
computer parts will diagnose there own.
Step 3: BIOS
(Basic Input Output System) BIOS is program which verifies all
the attached components and identifies device booting order
Based on device order BIOS will first boot device, in this
case we are considering as HDD as first boot device.
Step 4: MBR
(Master Boot Record) contains Boot Loader, Partition
information and Magic Blocks or validation check
MBR Size 512bytes
1.
Boot loader –
contains boot loader program which is 446 bytes in size.
2.
64 Bytes of
partition information will be located under MBR, which will provide /
redirects to actual /boot partition path to find GRUB2
3.
2bytes are magic
bytes or validation check to identify errors
Step 5: GRUB
GRUB displays the splash screen, waits for few seconds, if you
dont enter anything it loads the default kernal image as specified in the
grub configuration file.
GRUB configuration file is in RHEL7 /boot/grub2/grub.cfg
GRUB configuration file is in RHEL6 /boot/grub/grub.cfg
(Grand Unified Boot Loader) configuration file located in
/boot/grub2/grub.cfg which actually points to initramfs is initial
RAM disk, initial root file system will be mounted before real root file
system.
GRUB has the knowledge of the file system(the old version of
Linux Loader LILO didn’t understand filesystem).
Basically initramfs will load block device drivers such as
SATA, RAID etc.
The initramfs is bound to the kernel and the kernel mounts
this initramfs as part of a two-stage boot process.
Step 6: KERNEL
KERNEL is heart of OS, it is bridge between application and
hardware of computer, it is designed in c language.
When boot is processed, kernel will load. When kernel loading
completes it immediately look forward to start processes / Services. It takes
care of process mgmt, memory mgmt, resource mgmt, I/O etc
Name of kernel is Maipo 3.10 in RHEL7 & Santiago in RHEL 6
Kernel executes the /sbin/system in RHEL7 & /sbin/init
program in RHEL6.
Types of kernel
1.Microkernel
2.Monolithic kernel
Comparison Chart:
Step 7 : Starting
Systemd the first system process
Faster
bootup times since daemons start in parallel.
As we know before systemd there is no process / service
exists. Systemd will be started by a system call fork( ); fork system call
have an option to specify PID, that why systemd always hold PID 1.
As there is no sequence to start processes / Services, based
on default.target will start.
Services with system are named something.service
Such as
For example, To enable a service in RHEL7
#systemctl
enable mariadb.service
Then a symbolic link is created from
/etc/system/system/multi-user.target.wants/mariadb.service
That points to
/usr/lib/systemd/system/mariadb.service
Step 8 : Targets
To find which target belongs to which number
#ls –l
/usr/lib/systemd/system/runlevel0.target
#ls –l /usr/lib/systemd/system/runlevel1.target
-------------------------
#ls –l /usr/lib/systemd/system/runlevel6.target
Which
shows result as:
lrwxrwxrwx runlevel0.target ---->
poweroff.target
lrwxrwxrwx runlevel1.target
----> rescue.target
-------------------------
lrwxrwxrwx runlevel6.target
----> restart.target
Targets:
#systemctl
set-default <tab>
reboot.target
printer.target bluetooth.target
rescue.target shutdown.target sleep.target
initrd.target sound.target multi-user.target
network.target suspend.target default.target
runevel0.target runlevel6.target final.target
graphical.target umount.target nfs.target
Step 9: User Interface
(UI)
Once that’s done, the “Wants” entry tells systemd to start
the display-manager.service
service(/etc/systemd/system/display-manager.service), which runs the GNOME
display manager.
Your User interface start and prompt you for credential to
login.
Below are the commands to know time of booting process taken:
[root@server ~]# systemd-analyze time
Startup
finished in 1.895s (kernel) + 2.622s (initrd) + 20.402s (userspace) = 24.919s
[root@server ~]# systemd-analyze blame
6.850s firewalld.service
5.714s mariadb.service
5.509s tuned.service
5.350s plymouth-quit-wait.service
|
.
Comments
Post a Comment