5

So i tried to edit the /etc/inittab with sudo nano /etc/inittab:

I changed:

1:2345:respawn:/sbin/getty --noclear 38400 tty1

to:

1:2345:respawn:sbin/getty --autologin {USERNAME} --noclear 38400 tty1

Then I went ahead and changed it to:

1:2345:respawn:sbin/getty --autologin {pi} --noclear 38400 tty1

And was so stupid to forget to remove the brackets. now it's saying:

Authentication failure
INIT: Id "1" respawning too fast: disabled for 5 minutes.

I know that i can fix it by simply removing the brackets but i can't enter the raspberry pi now because it locks immediately.

How can i go about this?

techraf
  • 4,319
  • 10
  • 31
  • 42

1 Answers1

4

As far as I know there's no way to boot into runlevel 1 on the pi without configuring it to do so first, which is not really an option at this point.

That line applies to runlevels 2, 3, 4, and 5; the original default is 2, and that's what you are getting.

The only thing you can do is take the card out and fix inittab.


If you can't access the second partition on Windows, you could try adding:

init=/bin/bash

To the end of cmdline.txt on the first (vfat) partition, which should remain all one line. I can't promise this will work out, and you will certainly want to remove that afterward, but it may give you a command prompt.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
  • how will i be able to access inittab by connecting it to my windows computer? from my previous experiences, i've never found anything that i need when simply connecting the card into my computer. like everything looks different. – Alexander Sabiona Dec 17 '15 at 03:53
  • 1
    Windows doesn't come with ext4 (the filesystem type) support. There's some solutions to that recommended here, although I can't vouch for them. The other options would be to either use a linux "live CD", or install it in a virtual machine such as VirtualBox on windows (which requires the .iso image for CD and is more work, but does not require you actually burn a disk). – goldilocks Dec 17 '15 at 04:00
  • Right now i was able to view the contents of the sd card and saw root.tar and opened it using winrar and i was able to locate the inittab. was able to open it using notepad. Is this gonna work? – Alexander Sabiona Dec 17 '15 at 04:02
  • 1
    I guess you might as well try...I've edited in another suggestion at the bottom, but it is a pretty sketchy one. – goldilocks Dec 17 '15 at 04:06
  • I tried it and nothing happened. Thanks for your effort though :) uhm will entering recovery mode work? – Alexander Sabiona Dec 17 '15 at 04:08
  • You mean using the jumper like in the linked Q&A? I've never tried it but if it is as described there, yes it should work -- that won't use anything on the second partition but you should be able to access it. Apparently busybox comes with a vi (simple editor) implementation, which would allow you to edit inittab -- but it is not easy to use... – goldilocks Dec 17 '15 at 04:16
  • 1
    If you have the option of burning the live CD, that's the surest bet. They are usually slow and awkward, but have a full GUI desktop. – goldilocks Dec 17 '15 at 04:18
  • I tried the linked thread and the edit in cmdline.txt. nothing happened for both. – Alexander Sabiona Dec 17 '15 at 04:19
  • btw goldilocks, where should i add "init=/bin/bash" will it work by just simply adding it at the end of cmdline.txt? – Alexander Sabiona Dec 17 '15 at 04:34
  • 1
    I think so, but you might want to insert it right after the root=... parameter. – goldilocks Dec 17 '15 at 04:36
  • Alright i think i'm going somewhere here. i was finally able to open inittab using the raspberry pi itself but it says i have no permission to write it.

    the console looks like this:

    root@(none):/#

    What i typed was: root@(none):/# $sudo nano /etc/inittab

    – Alexander Sabiona Dec 17 '15 at 04:42
  • You don't have to use sudo, you're root. If that's from busybox, it's the wrong /etc/inittab; you'll have to mount the 2nd partition first: mount /dev/mmcblk0p2 /mnt (then it should be in /mnt/etc/inittab). If it isn't busybox, it's because the root fs is mounted read-only. Try mount -o remount,rw /dev/mmcblk0p2 /. – goldilocks Dec 17 '15 at 04:48
  • Not using busybox or anything. Just my raspberry pi and i added in the "init=/bin/bash" comment after cmdline.txt so i'm gonna try "mount -o remount,rw /dev/mmcblk0p2 /" – Alexander Sabiona Dec 17 '15 at 04:51
  • Going to accept this since as an answer, since your replies was able to guide me to the things i need. I used the suggestion from the linked question. The one that simply uses "init/bin/sh" and the instructions that followed. I am now able to enter the raspberry pi :D – Alexander Sabiona Dec 17 '15 at 05:14