13

After attempting setting up Raspberry Pi bluetooth to be bluetooth receiver for stereo, now whenever I start it up I can't SSH at all, I can't use the desktop at all or CTRL+ALT+Fnumber key to get to a terminal.

I tried startx=0 in config with shift key at startup, but that doesn't prevent it from freezing completely.

I see a failed message on booting so I think last tweak broke bluetooth... but how can I possibly get to a root console to fix it again? Even in Shift recovery mode, Ctrl+Alt+F1 does not let me log in as it rejects the password. This is on up-to-date Pi3.

  • 1
    I'm not sure if I've used recovery mode on Raspbian or not, but as a guess it only allows root logins and is rejecting the password because you have no root password set. There are two variations on this; one (the default) means you cannot log in root at all. The other is that you can log in without a password; you can make it so this way: raspberrypi.stackexchange.com/a/47129/5538 – goldilocks Feb 7 '17 at 11:32
  • @goldilocks Even so how would I log in when it immediately goes to desktop? – NoBugs Feb 8 '17 at 3:03
  • @NoBugs After it boots try going to another terminal with Ctrl + Alt + F2 – NULL Feb 13 '17 at 14:49
  • @NULL That's exactly what I had hoped would fix it... No response though, unless in Shift recovery mode and then it doesn't want to let me in... – NoBugs Feb 14 '17 at 2:51
  • Did you try to remove the SD and insert it to the computer to remove config file (easier to do on Linux machine that on Windows machine). – NonStandardModel Feb 19 '17 at 15:33
7

One way to get in to a safe mode of sorts can be accomplished by booting directly in to bash.

  1. Unplug and take the card out
  2. Mount it on a computer
  3. Open the drive, edit the cmdline.txt file and add " init=/bin/bash" at the end of the existing command. Note: the space before init is required.

Example:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 
rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait init=/bin/bash
  1. Unmount the card, put it back in your pi, and boot up. For me, the availability of a command line was not apparent until I pressed Enter on the keyboard.

  2. You will likely find that the card is not writable.

You can remount it as readable/writable by doing (adjust the device name if necessary):

mount -o remount,rw /dev/mmcblk0p2 /
  1. Track down that boo boo, exit the bash session, and unplug the pi
  2. Remount the card on your computer and remove " init=/bin/bash" from cmdline.txt and hopefully voila! Lather, rinse, and repeat if necessary.
  • 1
    I would add to this command should be "mount -o remount,rw /dev/mmcblk0p2 /" – Keith Phillips Feb 8 '18 at 1:53
  • In my case, I had to do mount -o remount,rw /dev/mmcblk0p2 / else it throws not mounted or invalid option error – palaniraja Jun 22 '18 at 8:47
  • Interesting! Not certain if something changed or what, but I've updated the post accordingly. Thanks for the heads up. – Kevin Reilly Nov 8 '18 at 23:31
  • where is the cmdline.txt ? it has to be created at root ? – snoob dogg Dec 18 '18 at 21:00
  • @snoobdogg When you mount the SD card on a computer, it should be in the root directory of the browsable filesystem. It is worth noting I have only confirmed this on the Raspbian distribution. – Kevin Reilly Dec 19 '18 at 22:20
3

Since you probably updated your raspian in the process, you might have been caught by this change:

As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually.

The solution to this is quite simple: Put the SD card into some other machine and place an empty file called "ssh" into the boot partition (aka the only partition you see on a windows computer).

  • I got caught by this so plugged it into an HDMI monitor, mouse & keyboard, and booted up then went to raspi-config to re-enable it. – SDsolar Mar 20 '18 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.