Chroot grub2

Today I forgot my root password, it must be Alzheimer. Anyhow here is the quick recipe to reset it. On the grub boot screen type ‘e’ for edit. Next edit the line starting with linux, at the end add init=/bin/bash it should look like this.

linux /boot/vmlinuz-version root=UUID=hex rw quite init=/bin/bash

Next hit Ctrl-X to boot, you should land on a prompt without having to type your password. Next enter the following two commands:

mount -o remount,rw or mount -a

passwd

Enter the new password twice, type the following:

sync

reboot

You should be all set!