Cannot boot after power-down without OS shutdown.

Started by Gienek, July 02, 2020, 06:31:09 PM

Previous topic - Next topic

Gienek

  Hello,
  I have just received new Lime2 board, and started testing it with Linux, installed on eMMC.
Accidentally, I have noticed that when power plug is pulled without prior shutdown, the board is not booting afterwards. I see only blank screen on monitor attached to HDMI. I have no serial console.
It can be rectified by installing image on SD card, booting, and transferring to eMMC again.
After first accident, I have repeated this several times, because it is essential for my future application to be able to 'switch off by power-down'.
Unfortunately, the problem repeats also very regularly.
My board variant is A20-OLinuXino-LIME2-e16Gs16M, powered by 5V power supply plugged to the barrel connector.
I am using the recent Armbian; uname -a:
Linux lime2 5.4.45-sunxi #20.05.3 SMP Wed Jun 10 12:09:20 CEST 2020 armv7l GNU/Linux
  Am I doing something very wrong with my setup, or it is the expected behavior? If this is the rule, what could be a solution for my demand of powering off without system shut down? Installing a battery and a daemon, which will shut down the system gracefully if power supply fails? Are there any ready solutions for this?
  Best regards,
  Gienek.

LubOlimex

I can't say about Armbian but it is generally unsafe to remove all power supply from the board and performing a hardware shutdown. Some file system corruption would likely occur if you do it repeatadly and if you haven't taken extra measures. The easiest way to prevent that would be to use a back-up Li-Po battery and detect when main power supply goes missing and keep track of battery charge (if main power supply goes missing for TOO LONG) so you can perform a software shutdown before the battery gets drained. Of course, there are more complicated ways to ensure no system corruption can occur, some of these can be found here:

https://www.embeddedarm.com/about/resource/preventing-filesystem-corruption-in-embedded-linux

Please also test with Olimage images from here:

http://images.olimex.com/release/a20/

You can install it to the emmc with:

olinuxino-sd-to-emmc
Technical support and documentation manager at Olimex

Gienek

Thank you very much for prompt answer.
The battery is very tempting. However, I will use this board with a 3.5 inch HDD. So best solution would need to cover the 12V supply, too.
For a different purpose, I moved swap, /var/log and /tmp to eMMC module and disabled zram and ramlog. Since then the issue somehow disappeared. Or got seldom - I am not pulling the plug very often.