1

I tried running sudo fdisk -l, but I get

sudo: unable to resolve host (none): Connection refused fdisk: cannot open /proc/partitions: No such file of directory found

I also tried running mount and I get

mount: failed to read mtab: No such file or directory

How can I fix this? The microSD works fine, I have used it on multiple devices, and tried fresh OS installs but it won't boot up. I have a RPI 3

To run those I put, init=/bin/sh in cmdline.txt

Greenonline
  • 2,740
  • 4
  • 23
  • 36
trixonet
  • 13
  • 2
  • 6
  • The title of your questions is, "My RPi 3 doesn't boot up" ??? – Seamus Aug 04 '18 at 15:05
  • Yes that is the title – trixonet Aug 04 '18 at 15:20
  • If it does not boot , what are you "reading"? Does SD green LED shows any activity ? Since you used SD on other devices – did you verify they you have bookable OS installed on it? I know that is a stupid question to ask - but as the old saying goes "it works better if you plug it in ( software) “ still applies here. – Jan Hus Aug 04 '18 at 15:22
  • I should say, it wont boot to desktop – trixonet Aug 04 '18 at 15:22
  • Ahhh! That's an entirely different thing you see. Booting comes first; once that process is finished, then the desktop environment is started. – Seamus Aug 04 '18 at 15:25
  • I just turned it on and I just see the raspberry pi symbols. – trixonet Aug 04 '18 at 15:28
  • If you boot into init=/bin/sh then there is only the shell running. No pseudo file systems from the kernel are mounted like /proc, /dev and /sys. Then of course you will not find anything from /proc like partitions or mount points. But this has nothing to do with your problem. – Ingo Aug 04 '18 at 16:31
  • If you flash the latest image from Raspbian Stretch and that will not boot then you have a general problem with your hardware, maybe defected SD Card or RasPi or power supply or something like this. – Ingo Aug 04 '18 at 16:47
  • just turned it on and I just see the raspberry pi symbols. Same question - what are you connected to ? ( If it did not finnish booting AT AL ....) – Jan Hus Aug 04 '18 at 18:23
  • @Ingo Yes I realize that by booting into init=/bin/sh is only shell, I was trying to see what the problem was by myself so I couldn't figure it out and that's why I'm here, and as I mentioned on the post the SD Card works perfectly fine on other devices. I just have a feeling the Pi is not detecting the partition? Since running "mount" and there isn't anything. The PSU works fine as well, tested with other devices. – trixonet Aug 04 '18 at 22:28
  • @JanHus What do you mean what am I connected to? As in I'm running an HDMI connection to a TV? The only things connected are HDMI, SD Card, Keyboard, and PSU. – trixonet Aug 04 '18 at 22:30
  • @trixonet what is PSU? – Ingo Aug 04 '18 at 23:18
  • Could you please show us the mount command you used and the messages you got back? Thank you. – NomadMaker Aug 05 '18 at 00:51
  • @NomadMaker mount: failed to read mtab: No such file or directory – trixonet Aug 05 '18 at 13:54
  • you say you've re-installed raspbian. Are you saing that on fresh install, without any changes at all to the operating system, you get the same errors? – Jaromanda X Aug 05 '18 at 23:48

1 Answers1

2

Let's look step by step where the error could be. You are booting into a shell without any graphics. In the shell maybe you can mount the pseudo filesystems from the kernel (/proc, /dev, /sys). But it will not help you. There is nothing else. You can only edit config files.

You try to boot into the graphics system that is the systemd graphical.target. That get stuck. Next step before is the multi-user.target. That is the system without graphics as you get it with Raspbian Stretch Light. Try to boot into this. If it works we have a running system Stretch Light and we know that the problem is the graphics part. You can boot into it by appending this to cmdline.txt:

systemd.unit=multi-user.target

If it runs we know the problem is the graphic system. You can enable journaling so we may see error messages. Enable it with:

rpi: ~# sudo mkdir -p /var/log/journal
rpi: ~# sudo systemd-tmpfiles --create --prefix /var/log/journal

Now boot into the graphic system until it get stuck wait a little and poweroff. Boot into the multi-user.target and look at the boot messages from the boot before with:

rpi ~$ journalctl --boot=-1

If you cannot boot into multi-user.target then you can get the next step back with appending this to cmdline.txt:

systemd.unit=rescue.target

Here you have a basic system including system mounts. Next step back is by appending to cmdline.txt:

systemd.unit=emergency.target

Here you have a bare system nearly to boot with init=/bin/sh. This should always do if you can boot with /bin/sh.

troubleshooting:
from the infos in your comments: it is possible to boot into multi-user.target but with read only filesystem. sudo cannot resolve host because there is no network connection with name resolution and for local name resolution there is no entry 127.0.1.1 raspberrypi (resp. your hostname) in the /etc/hosts I guess. Put it into /etc/hosts if not present.

On boot you get the error:

Timed out waiting for device dev/partuuid-fb3ed1c9\x2d01.device.

This shows that the device PARTUUID=fb3ed1c9-01 cannot be found. Postfix -01 shows it is the first partition, means the boot partition. It is possible that the partuuid has changed, for example by using a partitioner on a Raspberry installation. I suggest to change the device names in cmdline.txt and in etc/fstab. Put the SD Card in the card reader of your pc, mount its partitions and in cmdline.txt change the root entry to:

root=/dev/mmcblk0p2

etc/fstab change to similar like this:

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1

If mmcblk0 is not the right device name for your SD Card you can boot into multi-user.target and look in /dev what it is.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • I tried enabling journaling, but I get the error sudo: unable to revolve host (none): Connection refused. mkdir: cannot create directory /var/log/journal: Read-only file system – trixonet Aug 05 '18 at 13:49
  • I just tried booting with default cmdline.txt and get these https://imgur.com/a/eRw9waW – trixonet Aug 05 '18 at 14:42
  • @trixonet I have updated my answer with a section troubleshooting. – Ingo Aug 05 '18 at 16:34
  • where do I find the name in /dev? Also 127.0.1.1 raspberrypi is on /etc/hosts – trixonet Aug 06 '18 at 00:03
  • Nevermind, it started to work after a couple of reboots? I have successfully booted to desktop – trixonet Aug 06 '18 at 02:00