6

My Raspberry won't boot anymore. I had some problems, with mostly Mysql crashes in the past. But now it won't boot anymore.

The error it gives on boot:

Not syncing: No working init found. Try passing init= option to kernel. See Linux Documentatio/init.txt fot guidance.

Picture of the whole boot.
enter image description here

I've found people with this problem, but those are mostly ubuntu and solutions won't seem to apply to debian. I could be wrong on that.

Can anybody point me in the right direction?

janw
  • 503
  • 3
  • 7
  • 19
  • This most likely indicative of SD Card corruption. To rule out the obvious make sure the card is fully inserted. Suggestions covering Ubuntu on the Pi are likely to be worth trying as well. – Steve Robillard Feb 01 '16 at 09:13
  • Check, Now I get a different error `Starting init: /sbin/init exists but couldn't execute it (error -5)`. I also tried inserting it in my (windows) laptop, it gave one of those generic scan for errors popup, which I did. Now It's this error. – janw Feb 01 '16 at 09:31
  • To quote: "Debian can be considered the rock upon which Ubuntu is built.", so Debian answers would probably relate to Ubuntu, and vice versa... :-) – Greenonline Feb 01 '16 at 11:34
  • Check the permissions on the `/sbin/init` file. Also, is the `/sbin` directory in the same partition as the `/boot` and `/` partitions? – Greenonline Feb 01 '16 at 11:45

3 Answers3

3

A quick list of possible causes and solutions:

  • The root filesystem used by the kernel is incorrect. On the pi this is specified in cmdline.txt (on the first partition) by root= and for Raspbian should be mmcblk0p2. The rootfstype should be ext4.

    Solution: Correct the root filesystem parameter.

  • The root filesystem is corrupt.

    Solution: Run e2fsck on the root filesystem (using another computer).

  • The init file, /sbin/init (sometimes a symlink) or some necessary linked dependency has been moved or erased.

    Solution: If you did this, put it back. If you did not, reinstall the OS.

In most cases for most people these are things you can easily check in order, but if this fails, reinstall the OS. It is unrecoverable by you.

However, in your particular case there appears to be a kernel failure of some sort leading up to this; for a more normal example of a truly missing or bad init, see here. So you could try replacing kernel7.img (that's for the Pi 2, which I think this is) with a fresh one, e.g., from a clean image; most likely the required modules will still be installed on your system.

I suggest before you do anything, if possible, you try another SD card with a fresh image on it since this failure could be the result of hardware failure (e.g. bad RAM) and you need to rule that out before you waste time on other things.

I've found people with this problem, but those are mostly ubuntu and solutions won't seem to apply to debian. I could be wrong on that.

Mostly no (as in, they do apply) and yes (i.e., you're wrong), although there is a broad range of possible causes. Depending on which era you are talking about, Ubuntu and Debian use different init systems (the first paragraph of that article also describes the essence of your problem, which is true regardless of which init system would have been used) -- one of SysV, Upstart (Ubuntu only) or systemd.

MadMike
  • 583
  • 4
  • 19
goldilocks
  • 56,430
  • 17
  • 109
  • 217
  • A fresh SD boots. I tried your 3 options I think I need a reinstall [screenshot](http://i.imgur.com/EHMjsIJ.png). Is there a way to check for bad ram? – janw Feb 01 '16 at 15:52
  • Perhaps but if a fresh SD boots that is almost certainly not the problem. Particularly since the rootfs in that screenshot looks fubar'd. You could try #2 (`e2fsck`) but if that does not work then game over, reinstall. The SD card could be defunct too, I am not sure if there is a good way to test for this, but a clue would be if fsck reports a lot of *bad blocks*; do the normal fix first and/or re-install, then try `e2fsck -c` (see `man e2fsck`) or use `badblocks`. Note you cannot fix or blacklist them on an SD card, there is no point adding them to a list. The card is defunct. – goldilocks Feb 01 '16 at 15:59
0

The solution is :

  • do full fsck
  • re-compile uBoot with ALL filesystems suport and install it
  • insert correct kernel AND kernel7 files on your FAT partition(/boot)
Alexey Vesnin
  • 926
  • 9
  • 16
0

I had a similar problem after expanding the file system in My USB. The solution was to substitute the cmdline.txt with the default one.

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1  root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait ip=192.168.1.200::192.168.1.1:255.255.255.0:rpi:eth0:off

In my case I am using an SD card for booting and the filesystem in a USB (root=/dev/sda2).

Greenonline
  • 2,448
  • 4
  • 18
  • 33
Badr Bellaj
  • 111
  • 4