Boot Process and Recovery¶
The boot sequence¶
- Firmware (UEFI or BIOS) finds a boot device.
- Bootloader (GRUB2) loads the kernel and the initramfs.
- Kernel starts and mounts the root filesystem.
- systemd starts services up to the default target.
Find out why a boot failed¶
Recovery targets¶
sudo systemctl rescue # single-user, with basic services
sudo systemctl emergency # minimal shell with the root filesystem
A common cause of a failed boot is a bad /etc/fstab entry. Fix it from the emergency shell and test with mount -a.
Reset a lost root password (RHEL 8 and 9)¶
Only do this on systems you are authorised to administer, with console access.
- At the GRUB menu press
e, addrd.breakto the end of thelinuxline, then pressCtrl+x. - In the emergency shell:
mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel # fixes SELinux labels on the next boot
exit
exit
Tip
Protect your systems from this by securing console and bootloader access, and by using disk encryption where appropriate.