- POST (Power On Self Test) - Runs diagnostics on hardware.
- BIOS (Basic Input Output System) or UEFI (Unified Extensible Firmware Interface) - Finds and starts the boot loader.
- GRUB (Grand Unified Boot Loader) - Gives users a chance to choose an OS to run and offers older kernels, recovery mode, memory testing and a shell. GRUB usually loads the latest Linux kernel and intramfs automatically. It starts the kernel and exits.
- Linux Kernel - Initializes devices and loads drivers, kernel modules and the init program from initramfs. It then mounts the root filesystem and starts init with a process ID of 1. This is where the user space begins.
- Systemd - The init program found on most modern Linux distributions. It starts and manages essential services such as udevd and syslogd. It sets up network config and starts high level services like cron and cups. Once the services are running, it then starts getty for user login or a graphic desktop manager like GDK, KDM, or LightDM. The init program is also used to perform an orderly computer shutdown.
LINUX KERNEL BASICS Loading the kernel. GRUB - Loads the selected Linux kernel and its corresponding intiramfs file into memory from the /boot directory. It follows the commands in grub.cfg. It may also load additional kernel modules along with the main kernel. The grub.cfg file is maintained by the distribution but users can modify it by editing /etc/default/grub and then updating the GRUB program with the update-grub command. Boot - The kernel starts and GRUB exits. The kernel inspects the system and sets up hardware by loading drivers from initramfs. It mounts the root file system and then starts init. At this point, user space begins. dmesg - The kernel emits status messages during boot but most distributions do all they can to hide them from the user. Not all are logged but you can see most of them by running the dmesg command right after boot time.
GRUB
grub Accessing GRUB menu: For BIOS - Press and hold the Shift key at boot time. For UEFI - tap the Escape key after computer splash.
Systemd
systemd tech-services Systemd is goal oriented. It works toward a goal when booting and therefore can adapt to things like some services taking an unusually long time to load. Systemd uses targets instead of run levels. Systemd calls jobs ‘units’ and it activates those units.
Unit types: Service units (.service): These units manage the lifecycle of system services or daemons, including their startup, shutdown, and restart behavior. Socket units (.socket): These units define network sockets or IPC (Inter-Process Communication) sockets that can activate services upon receiving incoming connections or data. Target units (.target): These units serve as synchronization points during the boot process or for grouping other units. They are similar to runlevels but offer more flexibility. Device units (.device): These units represent kernel-managed devices and can be used to manage device-specific actions or dependencies. Mount units (.mount): These units manage file system mount points, defining how and where file systems are mounted. Automount units (.automount): These units define mount points that are automatically mounted on demand when accessed, rather than at boot time. Swap units (.swap): These units manage swap files or partitions, controlling their activation and deactivation. Path units (.path): These units monitor specific file system paths and can trigger the activation of other units when changes occur in those paths (e.g., a file is created or modified). Timer units (.timer): These units define timers for scheduled activation of other units, similar to cron jobs but managed by systemd. Snapshot units (.snapshot): These units represent snapshots of the current systemd state, allowing for temporary changes and potential rollback. Slice units (.slice): These units are used for resource management through Linux Control Groups (cgroups), allowing for the allocation and restriction of resources to processes. Scope units (.scope): These units are used to manage groups of externally created processes, providing a way to monitor and control them within systemd’s framework.
To list all the units on your system:
sudo systemctl --fullTo see the status of a running service
sudo systemctl status ###To see systemd log entries for a service
sudo journalctl -u ###