suj
Posts: 4
Joined: Sun Feb 03, 2019 11:39 am

USB boot working but unstable

Tue May 14, 2019 7:45 am

I have a remote pi 3B+ doing important home automation tasks. After having some SD cards broken due to power failures, I have prepared the set up with an SSD. The pi boots correctly without sd card, however booting proved to be unstable. Sometimes the pi does not reboot after a power outage. This failures are very short in time, it happens that other devices are not restarting at all. I think, this may cause a problem for the pi usb boot. As a quick solution, I have placed an other pi 2 next to it with a relay. This one boots every time without any problem after power failure from sd card and I use this one to restart the "main" pi 3. When I pull down the power for 10s for the main pi 3, it always reboots from the usb.

I will definitely install a ups, but this wil kind of masking the real problem.

How could I really improve booting stability from usb?

thanks

BespokeTech
Posts: 71
Joined: Thu Apr 04, 2019 8:14 pm

Re: USB boot working but unstable

Tue May 14, 2019 9:01 am

Hi,

I have never had much look with the USB boot either. I personally find SD cards to be highly reliable, but obviously depending on your Pi usage your mileage is going to vary.

I have installed Pi's into remote locations before, and I use a GSM controlled power switch....

https://www.amazon.co.uk/Decdeal-Wirele ... pons&psc=1

LTolledo
Posts: 1798
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: USB boot working but unstable

Tue May 14, 2019 10:10 am

suj wrote:
Tue May 14, 2019 7:45 am

How could I really improve booting stability from usb?
Definitely a stable power supply is required.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

arisoft
Posts: 2
Joined: Mon Jul 01, 2019 12:06 pm

Re: USB boot working but unstable

Mon Jul 01, 2019 12:53 pm

I have been studied my RBPi3+ with SSD drive. Originally I installed it by using NOOBS SD-card and Rasbian installed on SSD. This way it seems to work best as recommended in many forums.

I would like to have everything on the SSD so I started to test booting without an SD-card. At first, it didn't boot at all. The reason was clear. NOOBS did create vfat boot partition on the SSD but left it empty. I copied the boot directory from the SD card to the SSD and for my surprise, it booted normally without SD-card. I thought that everything was fine until I commanded a reboot. Reboot started correctly but it stops waiting for the root partition. If I pull the USB out and then return it back it continues loading the OS.

The interesting part is to find out how it can load boot partition from the SSD but not the root partition. Someone told me that using a powered hub between RBPi and SSD may help. I did not try this but instead, I inserted a LED which shows the +5V power state on the USB ports. And here it comes... The USB is powered off shortly after the boot code is loaded from the SSD which seems to cause SSD failing. The power-off state should last longer or eliminated to prevent my SSD failing.

The problem lies in the Rasbian bootloader. For some reason, there is a command for powering off USB for a fraction of a second before mounting the root partition. Can this be fixed or should I reroute SSD power directly from +5V GPIO pin?

I am also worrying about the shutdown process. The USB power seems to be shut down quite aggressively at early stage of the halt process. Is there a possibility that SSD drive is still writing something from the internal cache to the flash memory when the USB is powered off?

suj
Posts: 4
Joined: Sun Feb 03, 2019 11:39 am

Re: USB boot working but unstable

Tue Aug 20, 2019 8:02 am

I have done as suggested and installed a UPS for the pi. Unfortunately it did not solve all problems and after a few days I lost the pi 3B+. Then I also arranged for booting from SD and running the OS from SSD. I also re-installed everything. Now I have node-red, mqtt and mysql working. I copied only the bootcode.bin on the SD and it worked miraculosly for the first time. However, again, it stopped working after 4 days while a pi B+ running the same functions works still fine.
I still answers ping but nothing works.

The whole idea with the SSD was to to insure high reliability when running mysql DB and writing every minutes records. But it seems that it less stable than with sd card.

peter

User avatar
Gavinmc42
Posts: 3640
Joined: Wed Aug 28, 2013 3:31 am

Re: USB boot working but unstable

Tue Aug 20, 2019 8:13 am

What OS are you running?
I prefer PiCore for 24/7 Pi's
Power outs don't seem to affect them as the OS runs from ram.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

suj
Posts: 4
Joined: Sun Feb 03, 2019 11:39 am

Re: USB boot working but unstable

Tue Aug 20, 2019 11:06 am

I am running stretch. I have not heard about picore but it sounds promissing. I have pis running remotely and it is realy the most annoying thing when I am not able to connect them.

thanks

ddurdle
Posts: 61
Joined: Sat May 04, 2013 12:20 am

Re: USB boot working but unstable

Tue Aug 20, 2019 12:50 pm

You can also rethink your application need to determine if you can run the setup in read-only mode, at least for the operating system.

On deployed systems prone to power loss, I've had great success making all the partitions on the SD and USB read-only. You can use overlay to capture writes to the filesystem to RAM. when necessary, I have a small application space for read-write stored on a separate partition (if I need to store application stateful information).

Without this setup, those devices that would suffer power losses were no longer able to boot, needing to be re-imaged at the rate of about once every 4-6 months. Since I made this sets of changes about 3-4 years ago, I haven't had to reimage any of those devices.

Return to “General discussion”