Boot Process
A comprehensive guide to the Linux system boot process, bootloaders, and system initialization.
π Boot Sequence
BIOS/UEFI Stage
# BIOS/UEFI information
dmidecode -t bios # BIOS information
efibootmgr # EFI boot entries
ls /sys/firmware/efi # Check if booted in UEFI
mokutil --sb-state # Secure Boot status
# Boot configuration
/etc/default/grub # GRUB configuration
/boot/efi/ # EFI system partition
/boot/grub/ # GRUB filesBootloader Stage
# GRUB management
update-grub # Update GRUB config
grub-install # Install GRUB
grub-mkconfig # Generate config
grub-set-default # Set default entry
# Boot parameters
/proc/cmdline # Current boot parameters
systool -m kernel # Kernel module infoπ System Initialization
Kernel Stage
# Kernel information
uname -a # Kernel version
dmesg # Kernel messages
journalctl -k # Kernel logs
/proc/version # Kernel version info
# Kernel parameters
sysctl -a # Show all parameters
sysctl -w param=value # Set parameter
/etc/sysctl.conf # Persistent parametersInit Process
# Init system
ps 1 # Show init process
systemctl --version # Show systemd version
runlevel # Current runlevel
who -r # Current runlevel
# System state
systemctl get-default # Default target
systemctl list-units # Active units
systemctl status # System statusβοΈ System Services
Service Management
# Service control
systemctl start service # Start service
systemctl stop service # Stop service
systemctl restart service # Restart service
systemctl status service # Service status
# Service configuration
systemctl enable service # Enable at boot
systemctl disable service # Disable at boot
systemctl mask service # Prevent starting
systemctl unmask service # Allow startingService Dependencies
# Dependency management
systemctl list-dependencies service # Show dependencies
systemctl show -p Requires service # Required deps
systemctl show -p Wants service # Optional deps
systemctl show -p Conflicts service # Conflictsπ Boot Troubleshooting
Boot Problems
# Boot diagnosis
journalctl -b # Current boot log
journalctl -b -1 # Previous boot log
systemd-analyze # Boot time analysis
systemd-analyze blame # Service startup times
# Recovery options
systemctl rescue # Rescue mode
systemctl emergency # Emergency mode
init 1 # Single user modeBoot Recovery
# Recovery tools
update-initramfs -u # Update initramfs
mkinitrd # Create initrd
dracut # Generate initramfs
fsck # File system checkπ οΈ Boot Configuration
Kernel Configuration
# Kernel modules
lsmod # List modules
modprobe module # Load module
rmmod module # Remove module
modinfo module # Module information
# Module configuration
/etc/modules # Load at boot
/etc/modprobe.d/ # Module options
depmod -a # Update dependenciesBoot Parameters
# Boot options
/etc/default/grub # GRUB configuration
GRUB_CMDLINE_LINUX # Kernel parameters
GRUB_TIMEOUT # Boot timeout
GRUB_DEFAULT # Default entryπ Boot Performance
Performance Analysis
# Boot analysis
systemd-analyze # Boot time
systemd-analyze critical-chain # Critical path
systemd-analyze plot # Boot graph
systemd-analyze blame # Service times
# Service optimization
systemctl disable service # Disable unused
systemctl mask service # Prevent starting
systemctl reset-failed # Clear failedPerformance Tuning
# Boot optimization
systemctl disable service # Remove services
systemd-analyze security # Security analysis
systemd-analyze verify # Check unit filesπ‘ Best Practices
Boot Configuration
Regular GRUB updates
Secure boot setup
Backup boot files
Monitor boot times
Service Management
Minimize boot services
Configure dependencies
Regular service audits
Performance monitoring
Recovery Planning
Recovery procedures
Emergency boot options
Backup configurations
Test recovery plans
Security
Secure boot setup
Boot loader security
Service hardening
Access control
π§ Troubleshooting
Common Issues
# Boot issues
journalctl -xb # Detailed boot log
dmesg | grep -i error # Kernel errors
systemctl --failed # Failed services
blkid # Device UUIDs
# Recovery
fsck /dev/sda1 # Check filesystem
mount -o remount,rw / # Remount root
chroot /mnt # Change root
grub-install # Reinstall GRUBEmergency Recovery
# Emergency tools
systemctl emergency # Emergency mode
init=/bin/bash # Direct shell
break=init # Break boot process
single # Single user modeπ Boot Documentation
System Configuration
Boot sequence
Service dependencies
Recovery procedures
Performance baselines
Recovery Plans
Emergency procedures
Recovery tools
Backup strategy
Test procedures
Performance Monitoring
Boot time tracking
Service analysis
Resource usage
Optimization plans
π Learning Resources
Boot Process
BIOS/UEFI
Bootloader
Kernel initialization
System initialization
Tools and Utilities
Boot management
Service control
Analysis tools
Recovery tools
Best Practices
Configuration management
Performance optimization
Security measures
Recovery procedures
Last updated
Was this helpful?