Avoid inconsistent root password between OS and Dracut
This document (000020318) is provided subject to the disclaimer at the end of this document.
SUSE Linux Enterprise Server 12
Entering emergency mode. Exit the shell to continue. Type "journalctl" to view system logs. You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot after mounting them and attach it to a bug report. Give root password for maintenance (or press Control-D to continue): Login incorrect Give root password for maintenance (or press Control-D to continue: sh-4.4#
If you'll get the "Login incorrect" message and don't know the correct root password, chroot the installed system and run mkinitrd to update root's password in the ramdisk.
- Boot into rescue mode from the installation media
- Mount the root device to /mnt
- # mount /dev/root/device /mnt
- Rebind proc, sys, dev and run
- # for i in dev proc sys run ; do mount -o bind /$i /mnt/$i ; done
- Run chroot /mnt
- Make sure all system devices are mounted. Most of the time, you can simply run:
- # mount -a
- Run mkinitrd
- Confirm the root password is the same
- # grep root /etc/shadow
- # lsinitrd /boot/initrd /etc/shadow
- Exit and reboot
server:~ # grep root /etc/shadow server:~ # lsinitrd /boot/initrd /etc/shadowThe problem usually happens when the system has remained outdated. Long running, unpatched systems with regular root password changes will cause above behaviour. However, changing root's password once without updating the ramdisk will also cause the issue.
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020318
- Creation Date: 08-Jul-2021
- Modified Date:08-Jul-2021
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: email@example.com