amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Raspbian boot problem

Thu Mar 12, 2015 10:23 pm

Hello,

Quick bit of background info:
I have a Pi 2 running Raspbian. The Pi boots from the SD card, but the root FS is on a 2.5in USB SATA2 hard disk drive. The USB disk is attached to a powered USB hub. The Pi 2 is powered using an official Raspberry Pi power supply unit.

I came home from work today to find my Pi 2 was unresponsive. It had been working the night before. The last thing I did last night was to overclock the Pi2 using the "Pi 2" preset in raspi-config.

I connected up my USB TTL cable and found there was a lot of messages like this appearing, repeatedly:
smsc95xx 1-1.1:1.0 eth0: kevent 2 may have been dropped

I figured the Pi had just crashed or something, so I pulled the power, waited a minute, and powered it back on.

Now, the Pi boots, goes through all of the startup messages, and gets to the point where it re-mounts the EXT4-fs from sda1 (my root partition).

Then nothing.

No login prompt, no further error messages or debug output at all. No response to ping when I try pinging the Pi's IP address (it's a server, so it's set with a static IP) - so it hasn't finished booting.

I know the Pi itself is fine; if I remove the SD card, the console shows the card has been removed. I edited the /boot/cmdline.txt file to boot using /dev/mmcblk0p2 as the root partition, put the card back into the Pi (it showed the card being inserted), then pulled the power again, and put it back in a minute later. The Pi boots right through and works, but without all my software and stuff.

I also tried commenting out the lines pertaining to the overclock in the /boot/config.txt file, and rebooting again (just in case the overclock was making something funky happen), but that made no difference.

I've run fsck on all my partitions, and all of them are coming back as clean.

I can mount all of my partitions when I use the SD card's root partition, so I can access all of my data.

I don't necessarily *mind* blanking my disk-based root partition and reinstalling Raspbian to the HD again, but I really don't want to.

Can anyone help me work out why it gets right up to the point where the login prompt should appear, then sits twiddling its thumbs forever?

Kind regards
Graeme

User avatar
DougieLawson
Posts: 40821
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspbian boot problem

Fri Mar 13, 2015 8:06 am

1. Build a fresh SDCard with the latest Raspbian (or NOOBS/Raspbian)
2. Try a better power supply
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspbian boot problem

Fri Mar 13, 2015 10:01 am

1) The Pi boots off the Raspbian image on the SD card just fine; it's just that it no longer boots when I tell it to boot from my USB hard disk instead (a setup which has worked up until yesterday on my Pi 2, and in fact is still working on my original Pi B...)

2) The power supply is fine; it's the official Raspberry Pi power supply unit, and again, if I configure the cmdline.txt to use /dev/mmcblk0p2 as the root partition (instead of /dev/sda1), then the Pi boots and works just fine, even with all the USB devices attached. I can even mount all the drives and access my data from them once booted into Raspbian from the image on the SD card. In any case, there are no bus-powered USB devices connected to my Pi 2 at all; all I do have connected direct to the Pi 2 are the powered USB hub (which has two hard disks on it including the one I'm trying to boot from) and a powered USB hard drive. This isn't a power supply issue, it's a software issue.

I will accept that my setup is non-standard, but it's definitely not unique or unusual. All I've essentially done since getting my Pi 2 is:

1) connect a powered USB hub to it
2) plug a 2.5in USB hard drive to that USB hub
3) create three partitions on the drive (sda1 = root, sda2 = swap, sda3 = /home)
4) copy the content of /dev/mmcblk0p2 to the sda1 root partition
5) change fstab so the partitions are automatically mounted on boot
6) set the cmdline.txt to use /dev/sda1 as the root partition
7) reboot

From there, the SD card is only used to bootstrap the Debian bootup process from the USB disk. All the software services I've built and installed (samba4, serviio, apache2, mysql, php5, postfix, dovecot, horde, etc) have gone on to the USB disk, and have worked very well together - right up until yesterday. I don't know what caused it to stop working, and I have no idea why it's not booting. There are no error messages in the console output which displays the Raspbian bootup process.

While I'm quite happy to troubleshoot my own problems, and do a fair amount of Googling to find my own answers, I can't seem to get anywhere with this one.

I've just thought - I usually run my Pi headless, and configure it using an SSH session, so there's no HDMI device connected to it. As SSH has been unavailable (it doesn't boot to the point where it responds to pings to its IP address), I've been using a USB TTL cable connected via my Pi 1. No errors have appeared in the boot sequence when looking at it on the TTL connection; maybe there's a nice error waiting for me on the HDMI output? Will check when I get home from work.

User avatar
DougieLawson
Posts: 40821
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspbian boot problem

Fri Mar 13, 2015 10:12 am

What kernel version are you running? I found a firmware bug that prevents a USB root fs being mounted. https://github.com/raspberrypi/firmware/issues/374

Have you got an initramfs? Have you got rootdelay=5 in /boot/cmdline.txt?
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspbian boot problem

Fri Mar 13, 2015 11:13 am

DougieLawson wrote:What kernel version are you running? I found a firmware bug that prevents a USB root fs being mounted. https://github.com/raspberrypi/firmware/issues/374

Have you got an initramfs? Have you got rootdelay=5 in /boot/cmdline.txt?
I've no idea what kernel version I'm running - will need to look tonight. What's the best way to check which kernel version is installed on the hard disk if I can't get the afflicted install to boot?

Now you mentioned the bug via that Github link, I'm starting to think that maybe I ran a rpi-update at some point recently and possibly haven't rebooted since ... If I run rpi-update when booted from the SD card, does that update the /boot partition only, or does it update files on the root FS as well? If so, which files? I could mount my root partition and copy the updated files from the SD card root FS to my hard disk's root FS, reconfigure the cmdline.txt to boot from disk again, then reboot and cross my fingers

Not sure about initramfs; where would I look for that?

I definitely have the rootdelay=5 in my cmdline.txt file.

User avatar
DougieLawson
Posts: 40821
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspbian boot problem

Fri Mar 13, 2015 11:31 am

rpi-update updates /boot and /lib/modules

You need get off the 3.18.7 kernel.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspbian boot problem

Fri Mar 13, 2015 11:48 am

Thanks for that Dougie - I'll have another go at this when I get home. Fingers crossed!

Return to “Troubleshooting”