Boot Issues
A system that fails to boot is one of the most stressful types of failure. This article covers troubleshooting and repair methods for common boot issues including GRUB boot repair, rescue mode usage, fstab error diagnosis, and dracut problems.
Boot Process Overview
Section titled “Boot Process Overview”The boot flow of an EL system:
- Firmware (BIOS/UEFI) — Hardware self-test, loads the bootloader
- GRUB2 — Reads configuration, loads kernel and initramfs
- Kernel — Initializes hardware, mounts initramfs
- dracut/initramfs — Loads drivers, mounts the root filesystem
- systemd — Starts targets and services
Failures at different stages have different symptoms and solutions.
GRUB Rescue Mode
Section titled “GRUB Rescue Mode”When GRUB cannot find its configuration file or modules, it drops to the grub rescue> prompt.
Symptoms
Section titled “Symptoms”The screen displays:
error: no such partition.Entering rescue mode...grub rescue>Troubleshooting Steps
Section titled “Troubleshooting Steps”grub rescue> lsThis displays output like (hd0) (hd0,msdos1) (hd0,msdos2).
grub rescue> ls (hd0,msdos1)/boot/grub2/grub rescue> ls (hd0,msdos2)/boot/grub2/Once you find the partition containing the GRUB files:
grub rescue> set prefix=(hd0,msdos1)/boot/grub2grub rescue> set root=(hd0,msdos1)grub rescue> insmod normalgrub rescue> normalAfter the system boots, immediately repair the GRUB configuration:
$ sudo grub2-install /dev/sda$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg$ sudo dnf reinstall grub2-efi-x64 shim-x64$ sudo grub2-mkconfig -o /boot/efi/EFI/$(. /etc/os-release && echo $ID)/grub.cfgEmergency Mode
Section titled “Emergency Mode”Emergency mode is triggered when systemd cannot complete basic initialization, such as when /etc/fstab contains a filesystem that cannot be mounted.
Symptoms
Section titled “Symptoms”The screen displays:
Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" to try againto boot into default mode.Give root password for maintenance(or press Control-D to continue):Troubleshooting Steps
Section titled “Troubleshooting Steps”After logging in with the root password:
$ journalctl -xb --priority=err$ cat /etc/fstab$ mount -a 2>&1If a specific partition is causing the problem:
$ lsblk -f$ blkidAfter fixing the issue:
$ systemctl rebootRescue Mode
Section titled “Rescue Mode”Rescue mode boots from installation media and is used to repair a system that cannot start.
Entering Rescue Mode
Section titled “Entering Rescue Mode”- Boot from an AlmaLinux / Rocky Linux installation ISO
- Select Troubleshooting from the boot menu
- Select Rescue a system
The system will detect the installed OS and mount it to /mnt/sysimage.
$ chroot /mnt/sysimageYou can now execute repair commands as if you were on the normal system.
Manual Mounting (if auto-detection fails)
Section titled “Manual Mounting (if auto-detection fails)”$ lsblk -f$ mount /dev/sda2 /mnt/sysimage$ mount /dev/sda1 /mnt/sysimage/boot$ mount --bind /dev /mnt/sysimage/dev$ mount --bind /proc /mnt/sysimage/proc$ mount --bind /sys /mnt/sysimage/sys$ mount --bind /run /mnt/sysimage/run$ chroot /mnt/sysimageSingle User Mode
Section titled “Single User Mode”Single user mode is used to troubleshoot issues in a minimal environment, such as resetting the root password.
Entering Single User Mode via GRUB
Section titled “Entering Single User Mode via GRUB”- Press
eat the GRUB boot menu to edit the boot entry - Find the line starting with
linux(containingvmlinuz) - Append to the end of that line:
rd.breakorinit=/bin/bash - Press
Ctrl+Xto boot
Resetting the Root Password with rd.break
Section titled “Resetting the Root Password with rd.break”switch_root:/# mount -o remount,rw /sysrootswitch_root:/# chroot /sysrootsh-4.4# passwd rootsh-4.4# touch /.autorelabelsh-4.4# exitswitch_root:/# exitNote:
touch /.autorelabeltriggers a relabel of the entire filesystem’s SELinux labels on the next boot. This process may take anywhere from a few minutes to tens of minutes depending on the number of files. Do not force a shutdown during this process.
Viewing Boot Logs
Section titled “Viewing Boot Logs”Using journalctl
Section titled “Using journalctl”$ journalctl -b$ journalctl -b -1$ journalctl -b -p err$ journalctl --list-bootsUsing dmesg
Section titled “Using dmesg”$ dmesg | less$ dmesg --level=err,warn$ dmesg | grep -i -E '(sd[a-z]|nvme|ata|scsi)'Enabling Persistent Logging
Section titled “Enabling Persistent Logging”By default, journald logs on EL systems may not be persisted. Enabling persistence allows you to view previous boot logs:
$ sudo mkdir -p /var/log/journal$ sudo systemd-tmpfiles --create --prefix /var/log/journal$ sudo systemctl restart systemd-journaldFixing fstab Errors
Section titled “Fixing fstab Errors”Errors in /etc/fstab are a common cause of boot failures.
Common fstab Issues
Section titled “Common fstab Issues”- UUID does not match the actual partition (after disk replacement)
- References a non-existent partition
- Incorrect mount options
- NFS/CIFS remote mounts attempted before network is ready
Troubleshooting
Section titled “Troubleshooting”$ blkid$ cat /etc/fstab$ sudo findmnt --verify --tab-file /etc/fstabRepair Example
Section titled “Repair Example”If a partition’s UUID has changed:
$ sudo blkid /dev/sda2Example output: /dev/sda2: UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$ sudo vi /etc/fstabPreventing NFS Mounts from Blocking Boot
Section titled “Preventing NFS Mounts from Blocking Boot”For network filesystem mounts, add the _netdev and nofail options:
server:/export /mnt/nfs nfs defaults,_netdev,nofail 0 0nofail ensures the system boots normally even if the mount fails. _netdev ensures the mount waits for the network to be ready.
Reinstalling GRUB
Section titled “Reinstalling GRUB”BIOS Systems
Section titled “BIOS Systems”$ sudo grub2-install /dev/sda$ sudo grub2-mkconfig -o /boot/grub2/grub.cfgEFI Systems
Section titled “EFI Systems”$ sudo dnf reinstall grub2-efi-x64 shim-x64$ sudo grub2-mkconfig -o /boot/efi/EFI/$(. /etc/os-release && echo $ID)/grub.cfg$ efibootmgr -vReinstalling GRUB from Rescue Mode
Section titled “Reinstalling GRUB from Rescue Mode”If the system is completely unable to boot, after entering rescue mode from installation media:
$ chroot /mnt/sysimage$ dnf reinstall kernel-core$ grub2-install /dev/sda$ grub2-mkconfig -o /boot/grub2/grub.cfg$ dnf reinstall kernel-core grub2-efi-x64 shim-x64$ grub2-mkconfig -o /boot/efi/EFI/$(. /etc/os-release && echo $ID)/grub.cfgDracut / Initramfs Issues
Section titled “Dracut / Initramfs Issues”dracut is responsible for generating the initramfs (initial RAM filesystem), which contains the drivers and tools needed during the boot stage.
Symptoms
Section titled “Symptoms”dracut-initqueuetimeout during boot- Cannot find root filesystem
- Drops into the dracut emergency shell
dracut-initqueue[xxx]: Warning: dracut-initqueue timeoutdracut-initqueue[xxx]: Warning: Could not boot.Troubleshooting Steps
Section titled “Troubleshooting Steps”dracut:/# ls /dev/sd* /dev/nvme*dracut:/# journalctlRegenerating initramfs
Section titled “Regenerating initramfs”$ sudo dracut --force$ sudo dracut --force /boot/initramfs-$(uname -r).img $(uname -r)$ sudo dracut --force --add-drivers "megaraid_sas mpt3sas" /boot/initramfs-$(uname -r).img $(uname -r)Common dracut Issues
Section titled “Common dracut Issues”Missing storage drivers: If the storage controller was changed or the VM was migrated to a different platform:
$ lsinitrd /boot/initramfs-$(uname -r).img | grep -i driver$ sudo dracut --force --add-drivers "virtio_blk virtio_scsi virtio_net virtio_pci"Corrupted initramfs file:
$ ls -lh /boot/initramfs-*.imgIf the file size is abnormal (e.g., only a few KB), the file is corrupted and needs to be regenerated.
Unable to Boot After Kernel Upgrade
Section titled “Unable to Boot After Kernel Upgrade”Rolling Back to an Older Kernel
Section titled “Rolling Back to an Older Kernel”- Select the older kernel version from the GRUB boot menu
- If the GRUB menu does not appear (countdown too short), repeatedly press
Escor holdShiftduring boot
$ rpm -qa kernel-core | sort -V$ sudo grubby --set-default /boot/vmlinuz-<old-kernel-version>$ sudo dnf remove kernel-core-<problematic-version>