Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck booting when installed to USB #47

Closed
Limpster opened this issue Apr 22, 2014 · 14 comments
Closed

Stuck booting when installed to USB #47

Limpster opened this issue Apr 22, 2014 · 14 comments

Comments

@Limpster
Copy link

Installation to USB finishes, the pi reboots (normal) and is stuck after a few seconds; please see screenshot for details.
Happens with 4 different Sticks (from 2GB to 8GB, all I got).
The underscore ("command prompt" dont know the name, sry) keeps on blinking, I can attach a Keyboard to the Pi, it gets recognized and I am able to type but no command will be executed. Can remove and add Hardware, pi shows me the message but nothing happens :(

raspbian ua net installation to SD Card works fine, boots and I can work with the Pi.
(OpenELEC recognizes SD Card and Stick without problems, just wanted to mention it in case its a hardware issue)
Do you need more information? Be patient, I am new to this :D Couln't find a solution in the "solved" category, maybe I am blind...
bootusbpiraspbianuanetinstaller

@diederikdehaas
Copy link
Member

My first guess would be a power issue. I've seen/had issues similar to yours and it got 'fixed' by using the charger from my phone, which apparently does give enough power not to produce the issues.
And that was with no additional devices attached (no USB, no keyboard, etc).

The only thing that could contradict this guess, is that it appears to work with OpenELEC. But it could be that they made modifications to the system so that it uses less power and therefor less likely to suffer from power issues. AFAIK they do have optimized the filesystem, so this idea is not as far fetch as it may seen at first.
Different USB sticks also have different power requirements, so that could also be a factor. And USB likely uses more power then a SD card.

Do you have another power source you could use/try it with?
It should at a minimum be 5V at 0.7ampere, but more amperes is preferred.

@Limpster
Copy link
Author

@diederikdehaas
Thank you, I am using a 5V 1000mAh power source at the moment, I also gave it a try with my Samsung charger which has unfortunately even lower specs (5V/700mAh). It did not work out but was worth a try.
If raspbian is installed to sd card and a usb stick is attached it will boot up fine (even with two of them, tested it for fun). Actually the power source seems to be strong enough (at least in OpenELEC) to run with a wireless stick, a non powered usb hub, a stick and an infrared receiver and sometimes even more stuff plugged in with no issues.
Right now there is nothing else plugged in except the ethernet cable, the sdcard (of course), the stick and the HDMI cable (just to see the printout).
Maybe this issue belongs in the raspbian forums, I really dont know.
Did I do something wrong while installing the system to USB? I just added the line "usbroot=1" to "installer-config.txt".
Thank you :)

@diederikdehaas
Copy link
Member

Looks like you found a genuine bug Limpster 👍 and it is quite likely that your power source isn't the problem.
I just tested it and encountered the same issue that you've found.

@diederikdehaas
Copy link
Member

@hifi if usbroot is set, then 'sd_mod' and 'usb-storage' are being modprobed in the install script.
Are they automatically part of the initramfs and/or kernel or do those module need to be added there too?
@jaketri: since you implemented the USB stuff, maybe you can shed a light on this too?

@jaketri
Copy link
Contributor

jaketri commented Apr 24, 2014

I just updated exiting script to package into initramfs and load during setup the existing modules (from linux-image-3.10-3-rpi package) needed to access the USB during installation.

From your description look like installation finish successfully on the USB stick but your are stuck when you try to boot from the USB stick. Usually is is caused by missing kernel modules. After install (but before booting into USB stick) check that "sd_mod" and "usb-storage" modules are in /lib/modules/ or that are build in the kernel. I used raspberrypi-bootloader kernel package because it is the first one that have working SPI support. This one has the USB support compiled directly in the kernel.
You can check if the kernel have the modules build in by looking into "modules.builtin" files.

@diederikdehaas
Copy link
Member

Thanks for your response.

On Wednesday 23 April 2014 17:41:01 Jake wrote:

From your description look like installation finish successfully on the USB
stick but your are stuck when you try to boot from the USB stick.

Correct.

Usually is is caused by missing kernel modules. After install (but before
booting into USB stick) check that "sd_mod" and "usb-storage" modules are in
/lib/modules/ or that are build in the kernel.

After the failed bootup, I had to pull the power of my RPi, cause I couldn't
do anything with it.
Putting the USB drive in my main computer I noticed there is no /lib/modules/
directory!
Normally I'd grep config-, but I couldn't find it. Do you know
another way to determine it or in which file to look for build-in kernel
modules?

(I'm not really familiar with this part of Raspbian (or Debian))

But I'll modify the installer script (for testing purposes), so it'll pause at
the end of the installation so I can inspect the installed system before
rebooting.

I used raspberrypi-bootloader kernel package because it is the first one that
have working SPI support. This one has the USB support compiled directly in
the kernel. You can check if the kernel have the modules build in by
looking into "modules.builtin" files.

Also thanks for this pointer!
Since the /lib/modules/ directory didn't exist, I couldn't find the "modules.builtin" file either.
Now I know a bit more about the boot process so I can start digging a bit deeper :-)

Cheers

@diederikdehaas
Copy link
Member

Ok, this is weird.
Before rebooting there is /rootfs/lib/modules/ and I've added the modules to /rootfs/etc/modules.
After booting ... same issue ... so I pulled the power source again.
Putting the USB stick in my normal computer ... and there is no /lib/modules.
I'm rather puzzled at this moment ... :-/

@diederikdehaas
Copy link
Member

My previous comment was incorrect:
There is no /rootfs/lib/modules/ but there is a (fully populated) /lib/modules ...

@diederikdehaas
Copy link
Member

@Limpster Can you test something out for me? I think I've found the problem (and solution).
Install the system like you did before, but with the following modifications/additions to your installer-config.txt:

packages=btrfs-tools
rootfstype=btrfs

Don't worry if you don't (really) want to use btrfs, this is just to test something out.
The solution will (/should) work regardless of chosen filesystem type.

@Limpster
Copy link
Author

Limpster commented May 1, 2014

@diederikdehaas I did install with the modifications and it went a little better.
dsc_0004
As u can see a few errors appear, I have only 2 options: type in the root password (raspbian) or press CTRL+D (then the System reboots). If i type in the root password it says the following:
dsc_0005
Headless will not work, I also cant login via ssh. Installing to sdcard looks different :)

@diederikdehaas
Copy link
Member

Did you add the 'btrfs-tools' package to the packages config option?
I had the issue you just saw/reported too, but adding the btrfs-tools package fixed it with me.
Can you post your installer-config.txt (leave out anything you consider private)?
Not being able to login as root over ssh is an issue related to jessie, see #45 (comment)
EDIT: but that last part you already know, it's related to maintenance mode (ssh server isn't started then)

diederikdehaas added a commit to diederikdehaas/raspbian-ua-netinst that referenced this issue May 1, 2014
…em on USB.

This was mainly the cause when the root fstype was ext4, the default.
Hopefully this fixes issue debian-pi#47.

This was caused by an too old kernel and/or the absense of /lib/modules
in the resulting image. By setting 'kernel_module' to true, the kernel
package will be installed and the various modules will be build.

This is not a complete fix, since the other filesystems don't
automatically work. If the fstype is btrfs, then adding btrfs-tools to
the packages option makes it work. With f2fs things are a bit trickier,
since there is a f2fs-tools package, but only for jessie, not wheezy.

But this will fix the default case (ext4) and in the meantime I'll work
on a better fix for the other filesystem types.
@Limpster
Copy link
Author

Limpster commented May 3, 2014

Yes, I did as u told me, my installer-config.txt looks like this (no jessie install, since this was only for experimenting, I am aware of the issue :)

usbroot=1
packages=btrfs-tools
rootfstype=btrfs

I'd like to test it again but my raspberry refuses to copy the bootfiles and I just dont have the patience to keep fighting with my pi over and over again. If it works for you I guess you can concider it as fixed. Thank you for your help 👍
OT: do i have to build the latest version by myself or are the changes allways in the installer archive zip from the mainpage?

@diederikdehaas
Copy link
Member

On Saturday 03 May 2014 01:42:57 Limpster wrote:

Yes, I did as u told me, my installer-config.txt looks like this (no jessie
install, since this was only for experimenting, I am aware of the issue

usbroot=1
packages=btrfs-tools
rootfstype=btrfs

I'll test again with this exact configuration to see whether that will show
issues I haven't seen before.
Could also be related to the other issue (#50) and this would make a good test
case for it 👍

I'd like to test it again but my raspberry refuses to copy the bootfiles and
I just dont have the patience to keep fighting with my pi over and over
again.

I understand. Thanks for all the testing and reporting you have done, it's
much appreciated :-)

OT: do i have to build the latest version by myself or
are the changes allways in the installer archive zip from the mainpage?

If you want the latest changes, you would have to build it yourself.
The test I've asked you to do were meant to be done with the release we've
provided. It seemed the simplest for you to me, while still giving me the
information I was looking for.

I will be making a new release not too long from now, which should iron out
some bugs, but I want to test/experiment/fix some more before I actually make
that release. I'll leave this bug open till then as both a reminder to myself
and as a place for others to provide more info if they run into this issue
too.

Cheers!

@diederikdehaas
Copy link
Member

I've just released version v1.0.1 of the raspbian-ua-netinst project and that should fix this issue.
Hence I'm closing it.

diederikdehaas added a commit to diederikdehaas/raspbian-ua-netinst that referenced this issue Oct 23, 2014
Primary reason for this is the following comment on Debian bug #757941:
"More, I don't think reassigning it to glibc will do any good either,
because static linking has been discoraged there for ages."
(comment debian-pi#47).
Besides that, having to use a workaround because busybox-static
version 1.22.0-8 is getting annoying.
diederikdehaas added a commit to diederikdehaas/raspbian-ua-netinst that referenced this issue Dec 19, 2014
Primary reason for this is the following comment on Debian bug #757941:
"More, I don't think reassigning it to glibc will do any good either,
because static linking has been discoraged there for ages."
(comment debian-pi#47).
Besides that, having to use a workaround because busybox-static
version 1.22.0-8 is getting annoying.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants