RH134 Ch 8: Controlling the Boot Process

On RHEL 10 the firmware starts GRUB 2, GRUB loads the kernel and initramfs, and systemd takes over and brings the system to its default target. You can step in at every stage.

Targets. A target is a group of units that make up a system state. multi-user.target is a normal server with no GUI, graphical.target adds a desktop, and rescue.target and emergency.target are maintenance modes.

bash systemctl get-default systemctl set-default multi-user.target persistent systemctl isolate multi-user.target switch now only

At the GRUB menu you can press e and append systemd.unit=rescue.target to the linux line for a single boot.

Kernel arguments and GRUB settings. RHEL uses Boot Loader Specification entries in /boot/loader/entries. grubby edits them directly:

bash grubby --update-kernel=ALL --args="auditbackloglimit=8192" grubby --update-kernel=ALL --remove-args="rhgb quiet" grubby --info=ALL; grubby --default-kernel

Menu-wide settings such as GRUBTIMEOUT live in /etc/default/grub and only take effect after grub2-mkconfig -o /boot/grub2/grub.cfg. Editing grub.cfg by hand is pointless because it gets rebuilt.

Resetting a lost root password (rd.break). 1. Reboot and interrupt the GRUB countdown, then press e on the default entry. 2. Go to the end of the linux line, add rd.break, and press Ctrl-x. 3. At switchroot:/: mount -o remount,rw /sysroot, then chroot /sysroot. 4. passwd root, then touch /.autorelabel. No SELinux policy is loaded at this point, so the new /etc/shadow is unlabelled, and without the relabel root still cannot log in. 5. exit twice. The system relabels, reboots once more, and then accepts the new password.

init=/bin/bash works the same way, but you remount / and finish with exec /sbin/init.

Boot failures from fstab. A wrong UUID or a missing device in /etc/fstab drops the boot into emergency mode. Log in with the root password, mount -o remount,rw /, fix the line, run systemctl daemon-reload and mount -a, then reboot. You can avoid all this by running mount -a and findmnt --verify after every fstab edit.

Common exam mistakes - Skipping touch /.autorelabel after the password reset. - Changing /etc/default/grub without rerunning grub2-mkconfig. - Using isolate when the task asks for the default target. - Rebooting with a broken fstab and losing the remaining exam time.