Linux Programming and Cloud Computing

Installation, Boot Process, systemd and Login

PGCP-BDA

installation media

Bootable physical or virtual media containing an installer and packages used to create or repair an operating system.

partition and filesystem

A partition is a bounded block-device region; a filesystem organizes files, directories and metadata within storage.

bootloader

The bootloader selects and loads a kernel and initial RAM filesystem, then transfers control to the kernel.

kernel initialization

The boot stage in which the kernel detects hardware, initializes memory and drivers and starts the first user-space process.

initramfs

A temporary root filesystem loaded into memory during boot so the kernel can load drivers and mount the real root filesystem.

systemd target

A systemd unit that groups dependencies and represents a synchronization state such as multi-user or graphical operation.

service unit

A systemd unit that describes how a service starts, stops, restarts and depends on other units.

login session

The authenticated process environment created for a user, including identity, terminal, environment and session services.

shutdown

An orderly stop that ends services, flushes filesystem data, unmounts storage and finally powers off or reboots.

Installing and Booting Linux

Installation boots an image from USB, optical media or a virtual device. The installer detects hardware, creates partitions, builds filesystems and installs packages. A UEFI system normally uses a GUID Partition Table and an EFI System Partition. Separate root, home, swap and application areas may be chosen according to recovery and capacity needs. Formatting creates a filesystem while mounting attaches it to the Linux directory tree. A minimal server installation reduces unnecessary software and attack surface.

Firmware initializes hardware and selects a boot entry. A bootloader such as GRUB loads the kernel and initial RAM filesystem. The kernel initializes memory, scheduling and device drivers. initramfs provides early tools needed to discover, decrypt or assemble the real root filesystem. The kernel mounts that filesystem and starts process ID 1.

On a systemd distribution PID 1 activates units toward a target. Requires and Wants express dependencies while After and Before express order. Ordering alone does not cause another unit to start. systemctl start changes current state while systemctl enable configures a future boot. journalctl -b reads the current boot log. Login creates a session with user and group identities, a home directory, shell and environment. Shutdown stops services, flushes writes and unmounts filesystems before power-off.

Boot Configuration and Diagnosis

GRUB configuration identifies installed kernels and their command lines. The boot menu can select an older kernel or a recovery entry when a new kernel fails. Kernel parameters are visible through /proc/cmdline. The dmesg output records kernel initialization while the system journal continues with user-space services. systemctl --failed lists failed units and systemctl status name.service combines state, recent logs and process information.

Systemd units can be supplied by packages under system directories and overridden by administrator files under /etc/systemd/system. Drop-in files change selected directives without copying a complete vendor unit. After changing unit definitions systemctl daemon-reload makes the manager reread them. A service may be active even when its application is not healthy, so process state should be combined with application checks.

The default target is a link to a target unit such as multi-user.target or graphical.target. Rescue mode starts a small maintenance environment. Emergency mode provides an even more minimal shell. Filesystem or mount failures can prevent normal targets from being reached. Diagnosis follows the sequence in which control passes: firmware boot entry, bootloader files, kernel and initramfs, root-device discovery, filesystem mount, systemd units then the login service.

Continue learning

Related notes

Put this topic into timed practice

Open mock tests when you want full-exam pacing, or keep drilling in practice mode.