System Boot and Process Management
local graph
Chapter 7 — System Boot and Process Management
Section titled “Chapter 7 — System Boot and Process Management”When a SUSE Linux system starts, many components work together to initialize hardware, load the kernel, start background services, and prepare the user environment. Understanding how the boot process works and how to control system services is essential for both troubleshooting and performance tuning.
This chapter covers:
- GRUB2 bootloader
- Boot sequence and systemd
- System targets (runlevels model)
- Service control and process management
- Viewing and interpreting system logs
- Troubleshooting system boot failures
By the end, you will know how to bring a system up, down, and back to a working state even under failure conditions.
GRUB2 Bootloader
Section titled “GRUB2 Bootloader”GRUB2 is the bootloader SUSE uses to load the Linux kernel.
Key GRUB files:
/boot/grub2/grub.cfg Main configuration/etc/default/grub Default settings to regenerate configImportant: Do not edit grub.cfg directly. Modify /etc/default/grub and rebuild configuration:
sudo grub2-mkconfig -o /boot/grub2/grub.cfgExample: Change Default Boot Timeout
Section titled “Example: Change Default Boot Timeout”Edit:
sudo nano /etc/default/grubModify:
GRUB_TIMEOUT=5Rebuild GRUB config:
sudo grub2-mkconfig -o /boot/grub2/grub.cfgReboot and confirm:
sudo rebootGRUB control is vital when rescuing broken or misconfigured systems.
Boot Sequence Overview
Section titled “Boot Sequence Overview”SUSE boot flow:
- Firmware (BIOS or UEFI)
- GRUB2 (loads kernel and initramfs)
- Kernel initializes hardware
- systemd starts services and targets
- Login screen or shell appears
The key component here is systemd.
Understanding systemd
Section titled “Understanding systemd”systemd is the service and process manager used in modern Linux systems.
Check system status:
systemctl statusManaging Services
Section titled “Managing Services”Start a service:
sudo systemctl start service_nameStop a service:
sudo systemctl stop service_nameEnable service to start at boot:
sudo systemctl enable service_nameDisable service:
sudo systemctl disable service_nameCheck service status:
systemctl status service_nameExamples:
sudo systemctl restart sshdsystemctl status networkExam hint: SCA expects you to know these commands confidently.
System Targets (Modern Runlevels)
Section titled “System Targets (Modern Runlevels)”Targets are groups of services that define system states.
Common targets:
| Target | Purpose |
|---|---|
| graphical.target | GUI enabled system |
| multi-user.target | Multi-user, command-line system |
| rescue.target | Minimal system for recovery |
| emergency.target | Bare shell, used for manual rescue |
Check current target:
systemctl get-defaultChange target:
sudo systemctl set-default multi-user.targetsudo rebootTemporarily switch target (without reboot):
sudo systemctl isolate rescue.targetThis skill is critical during system recovery.
Process Management
Section titled “Process Management”List running processes:
ps auxInteractive system view:
topA more modern tool:
htopKill a process:
kill PIDForce kill:
kill -9 PIDFind PID by name:
pgrep service_nameSystem Logs and Debugging
Section titled “System Logs and Debugging”systemd uses journalctl to manage logs.
View all system logs:
journalctlView logs for a specific service:
journalctl -u service_nameView logs since last boot:
journalctl -bFollow logs live (useful for debugging):
journalctl -fExam tip: journalctl flags are frequently tested.
Troubleshooting Boot Issues
Section titled “Troubleshooting Boot Issues”If the system fails to boot, choose Advanced Options in GRUB menu and select:
- Older kernel
- Rescue mode
To enter emergency mode manually:
Add systemd.unit=emergency.target to the kernel line in GRUB edit mode.
In emergency mode:
mount -o remount,rw /Then fix:
- fstab issues
- Driver or module errors
- Misconfigured boot settings
Real-World Case Example
Section titled “Real-World Case Example”A server stopped booting after an admin mistakenly added an incorrect entry to /etc/fstab.
This caused the mount process to fail.
Fix:
-
Enter emergency mode: Boot with:
-
systemd.unit=emergency.target -
Remount root filesystem read-write:
-
mount -o remount,rw / -
Edit fstab:
-
nano /etc/fstab -
Comment out faulty entry.
-
Reboot normally.
This scenario appears commonly in production environments.
Memory Booster
Section titled “Memory Booster”To manage services, remember:
S T E D Start Stop Enable Disable
And associate them with:
systemctl startsystemctl stopsystemctl enablesystemctl disableFor logs, remember:
journalctl -u service_name
This will solve most troubleshooting questions.
Hands-On Exercise Lab 7
Section titled “Hands-On Exercise Lab 7”- Check your current boot target:
systemctl get-default- Change to multi-user mode:
sudo systemctl set-default multi-user.targetReboot and observe.
- Change back to graphical mode:
sudo systemctl set-default graphical.targetsudo reboot- Practice logs:
journalctl -u sshdjournalctl -f- Restart and verify a service:
sudo systemctl restart cronsystemctl status cronDocument:
- What changed
- What each command revealed
Reflection Questions
Section titled “Reflection Questions”- Why is GRUB rarely edited directly, and what is modified instead?
- What is the difference between a target and a service?
- When would you use rescue.target instead of emergency.target?
- Why are logs essential during troubleshooting?
Your answers indicate your operational maturity.
End-of-Chapter Summary
Section titled “End-of-Chapter Summary”In this chapter, you learned:
- The role of GRUB2 during system boot
- How systemd manages services and boot targets
- How to start, stop, enable, and disable services
- How to interpret system logs using journalctl
- How to troubleshoot system boot failures safely and confidently
You now have the knowledge to maintain stable and recoverable SUSE systems.