Page 1 of 1
root account is locked, starting shell
Posted: Sun Jul 24, 2016 5:18 pm
by c.brough
hi, i believe messing with my fstab to set up a networked time machine for my mac has messed with reboot. i am stuck at the following screen. everything was working great until i rebooted the machine using 'sudo reboot'.

- IMG_0597 (2).jpg (38.99 KiB) Viewed 71511 times
any obvious errors on my part or is there more info needed?
Re: root account is locked, starting shell
Posted: Sun Jul 24, 2016 6:54 pm
by SonOfAMotherlessGoat
Follow the directions given:
Type
and post the output.
Re: root account is locked, starting shell
Posted: Sun Jul 24, 2016 10:31 pm
by c.brough
cant ssh into rpi (or dont know how to) so how do i copy the output of your input?
here are photos of the output... over 100 lines
https://drive.google.com/folderview?id= ... sp=sharing
Re: root account is locked, starting shell
Posted: Sun Jul 24, 2016 10:47 pm
by asandford
c.brough wrote:cant ssh into rpi (or dont know how to) so how do i copy the output of your input?
Pull the card out and put it into a PC, edit cmdline.txt in the boot partition (the only one you'll see in windows) and add the foolowing to the end:
That will boot you into a root shell with no password required.
Re: root account is locked, starting shell
Posted: Sun Jul 24, 2016 11:05 pm
by c.brough
stuck on these last two lines now...
Code: Select all
/bin/sh: 0: can't access tty; job control turned off
# [ 6.658951] random: nonblocking pool is initialized
Re: root account is locked, starting shell
Posted: Sun Jul 24, 2016 11:12 pm
by asandford
c.brough wrote:stuck on these last two lines now...
Code: Select all
/bin/sh: 0: can't access tty; job control turned off
# [ 6.658951] random: nonblocking pool is initialized
Press enter/return key, should give a prompt
Re: root account is locked, starting shell
Posted: Mon Jul 25, 2016 12:22 am
by c.brough
ok, still cant ssh in
Code: Select all
Chriss-MBP:~ Chris$ ssh 192.168.3.174
ssh: connect to host 192.168.3.174 port 22: No route to host
Chriss-MBP:~ Chris$ ssh root@192.168.3.174
ssh: connect to host 192.168.3.174 port 22: Host is down
Chriss-MBP:~ Chris$
Re: root account is locked, starting shell
Posted: Mon Jul 25, 2016 11:31 pm
by c.brough
thinking my best option at this point is to do a fresh install of raspian.
if anyone has any way of rescuing my system I'll stick around for a few more hours before wiping.

Re: root account is locked, starting shell
Posted: Tue Jul 26, 2016 1:36 am
by asandford
c.brough wrote:ok, still cant ssh in
Code: Select all
Chriss-MBP:~ Chris$ ssh 192.168.3.174
ssh: connect to host 192.168.3.174 port 22: No route to host
Chriss-MBP:~ Chris$ ssh root@192.168.3.174
ssh: connect to host 192.168.3.174 port 22: Host is down
Chriss-MBP:~ Chris$
You won't be able to ssh in as the system isn't up, you've booted into a root shell (something like single user mode), so networking isn't running (or anything else really).
You should be able to edit the fstab or set a root password (with a keyboard and screen attached).
Re: root account is locked, starting shell
Posted: Wed Jul 27, 2016 7:21 pm
by DougieLawson
c.brough wrote:thinking my best option at this point is to do a fresh install of raspian.
Since you seem to be unable to follow the instructions to get a single user, no network, root shell to repair your broken system that's probably your best next step.
Re: root account is locked, starting shell
Posted: Sat Jul 30, 2016 5:55 pm
by c.brough
DougieLawson wrote:
Since you seem to be unable to follow the instructions...
i dont seem to recall the instructions you mention.
Re: root account is locked, starting shell
Posted: Sat Jul 30, 2016 6:00 pm
by DougieLawson
Re: root account is locked, starting shell
Posted: Sat Jul 30, 2016 6:09 pm
by c.brough
i did exactly that and posted back that i was then stuck at the two lines i had posted.
Re: root account is locked, starting shell
Posted: Sat Jul 30, 2016 6:35 pm
by epoch1970
You need to connect a keyboard to that machine and repair /etc/fstab from the shell. I think "nano /etc/fstab" should work in the limited environment you're running at that time.
The stock fstab (Raspbian Lite jessie) looks like that:
Code: Select all
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
Comment out anything else you've been adding.
If the root partition is read-only and you can't save the modified file, try "mount -o remount,rw /" and try again. (assuming the root partition is clean... Writing to an unclean fs is not a good idea.)
When you're done, do: "sync" a few times, then "exit". You'll see a crash dump, that's ok. Now power off the Pi and power it back on, if your repair was successful it will boot.
Otherwise if you're "stuck" or something, you could use an SD card reader and mount/repair from another linux machine. And your last option is to reinstall.
Re: root account is locked, starting shell
Posted: Tue Aug 02, 2016 11:42 pm
by asandford
c.brough wrote:
i did exactly that and posted back that i was then stuck at the two lines i had posted.
Not quite, you said you couldn't ssh in; which is to be expected as networking isn't up.
Re: root account is locked, starting shell
Posted: Wed Aug 03, 2016 10:19 am
by mfa298
Looking back at the original screenshot your already in a root shell, the clue is in:
Code: Select all
sulogin: root account is locked, starting shell
root@raspberrypi:~#
From there you can fix the /etc/fstab file as epoch1970 described.
The various instructions for setting init=/bin/sh seem fairly redundant as you already have a root shell to fix it from, you just need to use a keyboard connected to the pi.
Re: root account is locked, starting shell
Posted: Thu Aug 04, 2016 12:38 am
by asandford
mfa298 wrote:Looking back at the original screenshot your already in a root shell, the clue is in:
Code: Select all
sulogin: root account is locked, starting shell
root@raspberrypi:~#
From there you can fix the /etc/fstab file as epoch1970 described.
The various instructions for setting init=/bin/sh seem fairly redundant as you already have a root shell to fix it from, you just need to use a keyboard connected to the pi.
That dumps you into systemd's emergency mode, not single user mode. Whether the OP can acheive the same thing in that shell, I don't know as I've not been in that situation.
Re: root account is locked, starting shell
Posted: Mon Nov 21, 2016 1:57 am
by IgorGanapolsky
asandford wrote:c.brough wrote:cant ssh into rpi (or dont know how to) so how do i copy the output of your input?
Pull the card out and put it into a PC, edit cmdline.txt in the boot partition (the only one you'll see in windows) and add the foolowing to the end:
That will boot you into a root shell with no password required.
Nope, it doesn't resolve the problem.
Re: root account is locked, starting shell
Posted: Wed Nov 23, 2016 12:33 am
by asandford
IgorGanapolsky wrote:
Nope, it doesn't resolve the problem.
Doesn't resolve what problem?
Re: root account is locked, starting shell
Posted: Tue Jul 18, 2017 10:11 am
by domjunk
Thanks epoch1970 the /etc/fstab edit worked first time. I'm not sure why the entries had changed though but it might have something to do with adding a new USB drive before a reboot.
Re: root account is locked, starting shell
Posted: Mon Jan 15, 2018 1:37 pm
by javiersuarezv
hi, same happend to me (console locked) it was cause for an extraction of an usb memory that i was sharing by samba an apache, Saludos!
Re: root account is locked, starting shell
Posted: Sun Feb 25, 2018 3:47 am
by poof
Months later and I just encountered the same problem. The comment above on /etc/fstab clued me in. My Pi drive failed and that’s where I had moved my /temp swap space.