Every system administrator needs to understand the boot process on the OS in order to troubleshoot effectively.
>BIOS- basic input output setting(firmware interface)
POST: power on self test
>MBR is loaded: master boot record
Information saved in the first sector of the hard disk that indicates where GRUB2 is located so it can be loaded in the computer RAM.
>GRUB2 is loaded: grand unified boot loader v2. loads the linux kernel: /boot/grub2/grub.cfg
> Kernel is loaded: core of the OS.
loads the required drivers from the initrd.img, starts the first OS process.
> systemd process is started: System daemon (PID=1)
It then starts all the required processes. It reads /etc/systemd/system/default.target to bring the system to run-level. Total 7 run levels we have.
*************************************
How to reboot/shutdown:
power off the system:
# systemctl poweroff = stops all the running services, unmount all the filesystems. and then power off the system.
# systemctl reboot = stops all the running services, unmounts all the filesystems, and then reboots the system.
or we can use the shorter versions of these commands:
#shutdown: poweroff the server
#reboot: reboot the system.
#poweroff: poweroff the system.
**************************************
Selecting the Systemd Target:
>systemd is the first linux process which decides at which run level the operating system needs to be in.
These run levels are now referred to as targets.
following are the most important targets:
>graphical target: system supports multiple users, graphical and text based logins
>multi-user target :system supports multiple user text based logins only
>rescue target: sulogin prompt, bash system initialization completed .
>emergency target :sulogin prompt initramfs pivot complete and system root mounted on /read only
To check the current target or run level
#systemctl get-default
To check the current run level
#who-r
A target can be the part of another target eg the graphical target includes multi- user target, which in turn depends on basic taget and others
we can view these dependencies with the following command .
#systemctl list-dependencies graphical.target | grep target
you can display the new run levels/target by issuing the following command:
#ls -l /lib/systemd/system/runlevel*
how to change the run level /target ?
#systemctl set-default graphical.target
*************************************
How to recover the root password?
steps given below:
• Restart your computer.
• Edit the grub
•change password
•reboot
***********************************
Repair Filesystem Corruption
Filesystem corruption can occur when you either make mistakes in /etc configuration files.
or filesystem become corrupted at the disk level.
In either of the above cases the systemd will not be able to boot the system in the defined
target and bring the system in the emergency mode.
*****************************************
The following are the problems related to filesystem and its results:
>Corrupt filesystem: systemd attempts to repair the filesystem. If the problem is too sever for the automatic fix, the system drops the user to an emergency shell.
> Non consistent device or UUID referrenced in /etc/fstab: systemd waits for set amount of time, waiting for the device to become available. If the device does not become available, the system drops the user to an emergency shell after the time out
> Non existent mount point in /etc/fstab :system drops the user to an emergency shell.
>Incorrect mount options specified in /etc/fstab: system drops the user to an emergency shell.
*************************************
In any case administrators can use the emergency target to diagnose and fix the issue. because no file systems are mounted before the emergency shell is displayed.
When using the emergency shell to fix the filesystem issues, do not forget to run systemctl daemon-reload after editing /etc/fstab. Without this reload. systemd may continue using the old version.
Comments
Post a Comment