Openhabian how to recover /boot partition

Hello all,

I am not sure if this is the right forum, but I will try my luck. Hopefully somebody can help me.
What happend?
I am using since long time Openhabian on my Raspberry 3. I wanted to upgrade from 3.1 to 3.2 and did an

sudo apt-get update
sudo apt-get upgrade

After everything was installed I rebooted the system and somehow it did not reboot again.
To be on the safe side I immediatly did a clone of the SD card with

dd if=/dev/sdb of=/dev/sdc bs=512 status=progress

I do have access to the /rootfs partition.

I did download the latest openhabian and tested my pi if everything booting correct again. After seeing everything works fine I thought I could simply clode the first /partiion with dd.
Unfortunately it is still not booting.
I am not sure what could be the issue. Probably I need to use rsync and copy all files? I am not sure if the starting block might be an issue.

Could anybody has an idea? What could I do further?

Thanks in advance

openHABian has OH release management as well as disk mirroring built in but you chose to ignore both of these and did something on your own which was even explicitly prohibited to do in the official docs. And now that it doesn’t work you still ask for help?

If you asked me, what you really have to do is to at least read and follow the docs and thereby show a little bit more respect to the developers rather than to insist on doing your own ‘clever’ stuff .
(I’m referring to the third paragraph of the text this link points to)

Hi Markus,

First of all thanks anyway for your feedback.

Its not about having no respect. Thats really not fair. Because having such kind of respect I am asking for support. But you are right, RTFM somehow fits.

But one small feedback on the wording. You should change the phrase from “not recommended” to “prohibited”. This would not give any room for misinterpretations.

Even obviously I did a mistake, any chance to get some “high level hints” what I could try? I will not bother more…

Just install from scratch (that’ll install 3.1), import your config, and use the openHABian toolset to mirror and to backup before you try switching to 3.2 again. Use the 40 menu of openHABian for that.

Thanks Markus. Thats what I will do

Hi Markus,

I followed your recommendation and installed everything from scratch. I used the configuration tool as recommended.
Following are the settings:
01 Select Branch → openHAB3 recommended standard version of openHabian (openHAB 3)
02 Upgrade System → Done
03 Install openHAB ->openHAB3 is already installed on your system! Canceling migration, return to menu

Here I get following error message:
There was an error or interruption during the execution of:
“03 | Install openHAB”
Please try again. If the error persists, please read
/opt/openhabian/docs/openhabian-DEBUG.md or
openhabian/openhabian-DEBUG.md at main · openhab/openhabian · GitHub how
to proceed.

I tried to install the lates openHAB version using 41 (openHAB Mileston). I got the message, that everything is installed. Unfortunately after login via SSH I see following scrennshot. Somehow it seems something is not installed correctly. I guess I am not doing anything wrong. Any clue?

What is the output of

dpkg -l | grep -i openhab

Inspecting the version resp. package name you can detect which version is installed.

To me it looks like either your openhabian user’s .bash_profile does not make use of the latest functions. Upload that file.

Hi,
Installed is 3.2. Exact output:

ii  openhab                        3.2.0~M4-1                          all          openhab
ii  openhab-addons                 3.2.0~M4-1                          all          openhab-addons

.bash_profile:

# ~/.bash_profile: executed by bash(1) for interactive shells.

source /opt/openhabian/functions/helpers.bash

if [ -f "/opt/openHABian-install-failed" ]; then
  echo -e -n "\\n\e[31;01mAttention! \e[39;49;00m"
  echo "The openHABian setup process seems to have failed on your system."
  echo "Sorry, this shouldn't happen! Please restart the installation process. Chances"
  echo -e "are high setup will succeed on the second try.\\n"
  echo "In order to find the cause of the problem, have a look at the installation log:"
  echo -e "   \e[90;01msudo cat /boot/first-boot.log\e[39;49;00m\\n"
  echo "In order to restart the installation run:"
  echo -e "   \e[90;01msudo rm -f /opt/openHABian*; sudo reboot\e[39;49;00m\\n"
  echo "If the error persists, please read the debug guide at:"
  echo -e "\e[94;04mhttps://github.com/openhab/openhabian/blob/master/docs/openhabian-DEBUG.md\e[39;49;00m\\n"
  return 0
elif [ -f "/opt/openHABian-install-inprogress" ]; then
  echo -e -n "\\n\e[36;01mAttention! \e[39;49;00m"
  echo "The openHABian setup process has not finished yet."
  if [ -f /boot/first-boot.log ]; then watch cat /boot/first-boot.log; echo -e "\\nProgress log:\\n"; cat /boot/first-boot.log; echo; fi
  echo -e "\\nPlease wait for a few more minutes, all preparation steps will be finished shortly."
  return 0
fi

if [ ! -f "/usr/bin/raspi-config" ]; then
  alias raspi-config="echo 'raspi-config is not part of openHABian, please use openhabian-config instead.'"
fi

echo
FireMotD --theme Gray

if openhab3_is_installed; then OHPKG="openhab"; else OHPKG="openhab2"; fi

OHVERSION="$(sed -n 's/openhab-distro\s*: //p' /var/lib/${OHPKG}/etc/version.properties)"
OHBUILD="$(sed -n 's/build-no\s*: //p' /var/lib/${OHPKG}/etc/version.properties)"

echo -e "\\n$(sed -e 's|$OHVERSION|'"${OHVERSION}"'|g' -e 's|$OHBUILD|'"${OHBUILD}"'|g' -e 's|${HOSTNAME}|'"${HOSTNAME}"'|g' /opt/openhabian/includes/${OHPKG}logo)\\n"

if [[ -f $HOME/.profile ]]; then source $HOME/.profile; fi

# vim: filetype=sh

You are: Installing from scratch should result in 3.1 being installed so all of your steps except 41 were unneeded and possibly the reason for the output you are seeing.
Or you did something else (maybe copied some more files ? you must only use the restore function of openhabian-config) that results in openhab3_is_installed() returning false which is obviously wrong.
Please debug yourself, see code in /opt/openhabian/functions/helpers.bash.
Or install again without doing anything else yourself.

I dont get your point Markus.

I did modify nothing as your requested. Initial SW version was 3.1

What I did is simply to change the branch. Main reason for that: Initially it was set to main branch, but it is written that openHAB3 branch is recommended for openHABian

Then I did run a upgrade on the system. I think this was needed, since I saw lots of updates. Obviously the latest OpenHABian SW is not including all latest updates.

If the above mentioned steps are not needed in general why are they offered? I dont understand

As you can see I did not do anything else. And cannot see anything wrong here.

That’s not fully correct. Leave it to main. It’s the most up to date version of openHAB3.

That screendump you show can only happen if openHABian identifies OH2 (not 3!) is installed.
That happens in the code in .bash_profile you quoted. Find out why this goes wrong, try if it also happens in interactive shell:

set -x
source /opt/openhabian/functions/helpers.bash
openhab3_is_installed && echo oh3

Also set debugmode=maximum in /etc/openhabian.conf

They are needed in different contexts. Other users need it.

I will follow your recommendation. Thanks