c.brough
Posts: 7
Joined: Sun Jul 24, 2016 4:55 pm

root account is locked, starting shell

Sun Jul 24, 2016 5:18 pm

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
IMG_0597 (2).jpg (38.99 KiB) Viewed 53694 times
any obvious errors on my part or is there more info needed?

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: root account is locked, starting shell

Sun Jul 24, 2016 6:54 pm

Follow the directions given:

Type

Code: Select all

journalctl -xb
and post the output.
Account Inactive

c.brough
Posts: 7
Joined: Sun Jul 24, 2016 4:55 pm

Re: root account is locked, starting shell

Sun Jul 24, 2016 10:31 pm

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
Last edited by c.brough on Sun Jul 24, 2016 10:53 pm, edited 1 time in total.

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: root account is locked, starting shell

Sun Jul 24, 2016 10:47 pm

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:

Code: Select all

    init=/bin/sh
That will boot you into a root shell with no password required.

c.brough
Posts: 7
Joined: Sun Jul 24, 2016 4:55 pm

Re: root account is locked, starting shell

Sun Jul 24, 2016 11:05 pm

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 

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: root account is locked, starting shell

Sun Jul 24, 2016 11:12 pm

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

c.brough
Posts: 7
Joined: Sun Jul 24, 2016 4:55 pm

Re: root account is locked, starting shell

Mon Jul 25, 2016 12:22 am

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 [email protected]
ssh: connect to host 192.168.3.174 port 22: Host is down
Chriss-MBP:~ Chris$ 

c.brough
Posts: 7
Joined: Sun Jul 24, 2016 4:55 pm

Re: root account is locked, starting shell

Mon Jul 25, 2016 11:31 pm

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. :shock:

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: root account is locked, starting shell

Tue Jul 26, 2016 1:36 am

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 [email protected]
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).

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: root account is locked, starting shell

Wed Jul 27, 2016 7:21 pm

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.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

c.brough
Posts: 7
Joined: Sun Jul 24, 2016 4:55 pm

Re: root account is locked, starting shell

Sat Jul 30, 2016 5:55 pm

DougieLawson wrote: Since you seem to be unable to follow the instructions...
i dont seem to recall the instructions you mention.

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: root account is locked, starting shell

Sat Jul 30, 2016 6:00 pm

Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

c.brough
Posts: 7
Joined: Sun Jul 24, 2016 4:55 pm

Re: root account is locked, starting shell

Sat Jul 30, 2016 6:09 pm

i did exactly that and posted back that i was then stuck at the two lines i had posted.

epoch1970
Posts: 3077
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: root account is locked, starting shell

Sat Jul 30, 2016 6:35 pm

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.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: root account is locked, starting shell

Tue Aug 02, 2016 11:42 pm

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.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: root account is locked, starting shell

Wed Aug 03, 2016 10:19 am

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
[email protected]:~#
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.

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: root account is locked, starting shell

Thu Aug 04, 2016 12:38 am

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
[email protected]:~#
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.

User avatar
IgorGanapolsky
Posts: 33
Joined: Sun Apr 10, 2016 8:32 pm

Re: root account is locked, starting shell

Mon Nov 21, 2016 1:57 am

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:

Code: Select all

    init=/bin/sh
That will boot you into a root shell with no password required.
Nope, it doesn't resolve the problem.

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: root account is locked, starting shell

Wed Nov 23, 2016 12:33 am

IgorGanapolsky wrote: Nope, it doesn't resolve the problem.
Doesn't resolve what problem?

domjunk
Posts: 2
Joined: Tue Jul 18, 2017 10:07 am

Re: root account is locked, starting shell

Tue Jul 18, 2017 10:11 am

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.

javiersuarezv
Posts: 1
Joined: Mon Jan 15, 2018 1:31 pm

Re: root account is locked, starting shell

Mon Jan 15, 2018 1:37 pm

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!

poof
Posts: 1
Joined: Sun Feb 25, 2018 3:36 am

Re: root account is locked, starting shell

Sun Feb 25, 2018 3:47 am

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.

Return to “Beginners”