0% found this document useful (0 votes)
86 views

Boot - Process, Systemd - RUN Levels

The BIOS initializes hardware and loads the MBR, which loads the bootloader (GRUB) from the hard disk. GRUB loads the Linux kernel from disk into memory and passes control to it. The kernel then initializes drivers and launches the init process to start essential system services and bring the system to the desired runlevel.

Uploaded by

Arunaigiri Nm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views

Boot - Process, Systemd - RUN Levels

The BIOS initializes hardware and loads the MBR, which loads the bootloader (GRUB) from the hard disk. GRUB loads the Linux kernel from disk into memory and passes control to it. The kernel then initializes drivers and launches the init process to start essential system services and bring the system to the desired runlevel.

Uploaded by

Arunaigiri Nm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Linux Boot Process

1. BIOS(Basic Input/Output System)—System startup/hardware initilazion


a. Run POST operation.
b. Selecting first Boot device
2. MBR(Master Boot Record) – Boot loader stage 1
MBR is a small part of Hard Disk with just a size of 512 Bytes.
Primary boot loader code(This is of 446 Bytes)
Partition table information(64 Bytes)
Magic number(2 Bytes)
3. LILO or GRUB -- Boot loader stage 2
Once the Bootloader stage 1 is completed, Stage 1 bootloader start second stage by loading Bootloader into memory.
In this stage GRUB(Grand Unified Bootloader) which is located in the first 30 kilobytes of hard disk immediately following the
MBR is loaded into RAM for reading its configuration and displays the GRUB boot menu (where the user can manually specify
the boot parameters) to the user.
GRUB loads the user-selected (or default) kernel into memory and passes control on to the kernel. If user do not select the
OS, after a defined timeout GRUB will load the default kernel in the memory for starting it.
Linux Boot Process
GRUB: GRand Unified Bootloader
The GRUB menu interface configuration file is /boot/grub2/grub.cfg.
The commands to set the global preferences for the menu interface are placed at the top of the file, followed by stanzas for
each operating kernel or operating system listed in the menu.
The following is a very basic GRUB menu configuration file designed to boot either Red Hat Enterprise Linux
Linux Boot Process
Linux Boot Process
4. Kernel
Once the control is given to kernel which is the central part of all your OS and act as a mediator of hardware
and software components.
Kernel once loaded into to RAM it always resides on RAM until the machine is shutdown.
Once the Kernel starts its operations the first thing it do is executing INIT process.
6. init Process
Default runlevel set in /etc/inittab
Run Level 0 -- Halt
Run Level 1 – Single user mode without N/W and X11(for special Administration)
Run Level 2 – Multiuser with N/W but without NFS
Run Level 3 – Full multiuser with N/W but without X11
Run Level 4 – Not used
Run Level 5 – Full multiuser with N/W and X11(GUI)
Run Level 6 -- Reboot
What is init

In Linux, init is a abbreviation for Initialization. The init is a daemon process


which starts as soon as the computer starts and continue running till, it is
shutdown. In-fact init is the first process that starts when a computer
boots, making it the parent of all other running processes directly or
indirectly and hence typically it is assigned “pid=1“.

systemd – A init replacement daemon designed to start process in parallel,


implemented in a number of standard distribution – Fedora, OpenSuSE,
Arch, RHEL, CentOS, etc
What is systemd
A systemd is a System Management Daemon named with UNIX convention
to add ‘d‘ at the end of daemon. So, that they can be easily recognized.
Initially it was released under GNU General Public License, but now the
releases are made under GNU Lesser General Public License. Similar to init,
systemd is the parent of all other processes directly or indirectly and is the
first process that starts at boot hence typically assigned a “pid=1“.
Why there was a need to replace init?
A init process starts serially i.e., one task starts only after the last task
startup was successful and it was loaded in the memory. This often resulted
into delayed and long booting time. However, systemd was not designed
for speed but for getting the things done neatly which in turns avoid all the
UN-necessary delay.
Features of systemd
Clean, stateforward and efficient design.
Simpler boot process.
Concurrent and parallel processing at boot.
Better API.
Simple Unit Syntax.
Ability to remove optional components.
Low memory footprints.
Improved technique to express dependencies.
Initialization instruction written in config file and not in shell script.
Make use of Unix Domain Socket.
Job Scheduling using systemd Calendar Timers.
Event Logging with journald.
Choice of logging System events with systemd as well as syslog.
Logs are stored in binary file.
systemd state can be preserved to be called later in future.
Track process using kernel’s cgroup and not PID.
Users login managed by systemd-logind.
Better integration with Gnome for interoperability.
List Runlevel
Current Runlevel & List Dependencies
List Dependencies
Change Runlevel 3 to 5
Change Runlevel 3 to 5
\
Change Runlevel 3 to 5
Change Runlevel 3 to 5
OLD Console

• Text-mode login at virtual console


• Multiple non-GUI logins are possible
• Default consoles are in text mode
• Available through CTRL-ALT-F[1-6]

• Graphical login
• Graphical console comes through CTRL-ALT-F7
Latest Console

• Text-mode login at virtual console


• Multiple non-GUI logins are possible
• Default consoles are in text mode
• Available through CTRL-ALT-F[2-6]

• Graphical login
• Graphical console comes through CTRL-ALT-F1

You might also like