18

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.

NoBugs
  • 281
  • 1
  • 2
  • 7

3 Answers3

14

This Answer is out of date (Raspbian now uses PARTUUID to identify root partition) and uses /bin/bash rather than the POSIX compliant /bin/sh

It may work to repair the partition, but changing cmdline.txt to contain root=/dev/mmcblk0p2 (without a matching change to etc/fstab) may cause subsequent boot problems.

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 append "init=/bin/bash" at the end of the existing command.

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.
goetz
  • 103
  • 3
Kevin Reilly
  • 241
  • 2
  • 4
4

The traditional way to get into "Safe" mode, otherwise known as "single user" mode, is to add an "S" to the end of the command line.

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait S

Instead of bypassing all the system can do, this tells init the runlevel is "S", and it can then do special things to support this case. I just tested this with my semi-ancient installation of Jessie.

The boot command line can typically be found in "/boot/cmdline.txt".

Hack Saw
  • 156
  • 4
4

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).

dube
  • 149
  • 3