RHEL 8 reboot hangs on rd.break

257 Views Asked by At

I’m trying to follow https://linuxconfig.org/redhat-8-recover-root-password to reset a root password on a RHEL8 box.
enter image description here I successfully select ‘e’ on image ‘4.18.0-240.1.1.el8_3.x86_64’ and arrive at the ‘edit’ screen.
enter image description here I see a ‘linux’ line, but content ends after “crashkernel=auto”. The “resume=” and other stuff from the tutorial is missing. I added “ rd.break” right after “crashkernel=auto”, but after Ctrl-X, it hangs indefinitely (I waited up to 30 minutes). I never get the switch_root prompt shown by the tutorial. Any ideas why it would not get to that prompt?

1

There are 1 best solutions below

0
Divyansh Raina On

Steps to reset root password if forgotten and have no sudo user:

1) reboot to system, wait for grub menu to load (press shift if no rescue image is present to enter grub)
2) press `e` to edit the option 
3) remove 'console=tty0' & 'console=ttyS0,115200n8' (second param might be slightly different) from the line starting with "linux" and at the end of the line add "rt.break setenforce=0" 
4) press Ctrl+x to boot
5) Do mount -o remount,rw /sysroot
6) Do chroot /sysroot
7) Do passwd root and set the password
8) Do touch /.autorelabel
9) Do exit
10) Do reboot

Now you should be able to login into root without any worries. PS (If console-tty0 option is not present it can be skipped) but as it is present in your "linux" I have added.

Just recently solved this :) partially with the help of this link: https://forums.rockylinux.org/t/how-to-recover-root-password/3433