Back to Notes
rhcsaNODE: #rhcsa-troubleshooting-root-reset

Root Password Recovery and System Troubleshooting (rd.break)

Recovering lost root passwords using rd.break emergency shell, remounting sysroot read-write, and managing SELinux filesystem autorelabeling in RHEL 9.

AKA:rd.break, root password reset, emergency shell, SELinux autorelabel
#rhcsa#redhat#linux#troubleshooting#grub#rhel9#sysadmin

Root Password Recovery and System Troubleshooting (rd.break)

In the RHCSA practical exam, virtual machines may have unknown root passwords upon initialization, or misconfigured /etc/fstab entries may drop the machine into emergency mode. Knowing how to break the boot sequence and regain root access is a non-negotiable survival skill.

1. Step-by-Step rd.break Root Password Reset

Step 1: Interrupt GRUB Bootloader

  1. Power on or reboot the machine.
  2. At the GRUB2 boot menu, press e to edit the highlighted kernel boot entry.
  3. Use the arrow keys to scroll down to the line starting with linux (or linux16 / linuxefi).
  4. Move the cursor to the end of that line, type a space, and append:
    rd.break
  5. Press Ctrl + x (or F10) to boot into the initramfs emergency break shell (switch_root:/#).

Step 2: Remount /sysroot in Read-Write Mode

At the emergency prompt, the real root filesystem is mounted at /sysroot in read-only mode (ro):

# Verify mount status
mount | grep sysroot

# Remount /sysroot as read-write
mount -o remount,rw /sysroot

Step 3: Enter chroot Jail

# Switch execution environment into the installed OS
chroot /sysroot

Step 4: Reset the Root Password

# Update password for root user
passwd root
# Enter and confirm new root password

Step 5: Force SELinux Autorelabeling

[!CAUTION] If you omit this step, SELinux will reject the updated /etc/shadow file during normal boot, completely locking you out of the machine!

# Create hidden flag file at root filesystem to trigger automatic relabeling
touch /.autorelabel

Step 6: Exit and Reboot

# Exit chroot
exit

# Exit emergency shell to resume boot
exit

The system will automatically reboot, relabel modified files with correct SELinux contexts, and present the standard login prompt with your new root password.

Cross-references: