Emergency mode with root account locked
I was changed the /etc/fstab file to permanently mount a USB drive, but when I rebooted, I was welcomed with an emergency mode message. However, below the message it says my root account is locked and so I cannot use any commands to fix this issue. Is there a way I can still regain control of my computer? Will recovery mode help me solve this issue?
Here is the message it is displaying:
You are in emergency mode. After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" or “exit” to boot into default mode.
Cannot open access to console, the root account is locked. See sulogin(8) to continue.
Press Enter to continue.
Archived post. New comments cannot be posted and votes cannot be cast.
Sort by:
Qa (Default)
Open comment sort options
Comments Section
Boot again, edit the grub boot options, add init=/bin/bash to the end of the kernel cmdline.
You can then remount / as rw and edit your fstab.
I am inside the grub boot options. Where exactly do I find where to add “init=/bin/bash”?
Excuse my ignorance, how do I access the grub menu during boot?
Other way, Flash the os on usb drive, boot into it.
Go to your system's /etc/fstab file, correct the mistakes and reboot to your system os.
How do I flash the os without root access?
Use a Linux live cd and change the password of root using sudo passwd root command. Here are the steps .
Mount the drive: sudo mount /dev/sda1 /mnt (change sda1 to drive where your Linux filesystem is stored )
Change root folder : sudo chroot /mnt
Change root password : passwd root (Use easy password like 123)
Reboot
Incase some error dialogue is coming while booting to Linux you can simply go to recovery mode and connect to your wifi and run apt update and apt upgrade command .