Raspberry Pi Boot Issue - Root account locked!

After a power outage, my Raspberry Pi 400 Keyboard Computer wouldn’t boot. The Pi would get stuck at boot with the following error message.

Cannot open access to console, the root account is locked.

While not too descriptive, the error message asked me to use sulogin and run journalctl -xb; however, there was no shell to run or list anything.

Note: You will need access to a display, keyboard, and a laptop/desktop to do the following steps

In some cases, you will not be able to save your changes, and the system will complain of a read-only file system. If you get that, move to the following sections.

A raspberry pi SD card will have two primary partitions; since we cannot read the partition table directly, you must manually locate the device for your root and boot partitions. You can do this by going to the /dev directory, and you should see something similar to mmcblk0p1 & mmcblk0p2. The second device mmcblk0p2 will be your root partition. You need to remount this with read/write permissions.

mount -o remount,rw /dev/mmcblk0p2 /

Once this is remounted, go ahead and edit your /etc/fstab and save it.

Before you exit, make sure you revert the change to the cmdline.txt in the /boot partition. You may need to mount that in read/write mode as well before you can change it.

mount -o remount,rw /dev/mmcblk0p1 /boot

Alternatively, you can revert the change to cmdline.txt on your laptop or desktop.

If everything goes well, you should be able to boot back your Pi in a usual way.

comments powered by Disqus