# Openhabian how to recover /boot partition

**URL:** <https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762>\
**Category:** HABPanel\
**Created:** [November 14, 2021, 4:12pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762 "2021-11-14T16:12:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![shuo](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shuo](https://community.openhab.org/u/shuo)\
**Post date:** [November 14, 2021, 4:12pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/1 "2021-11-14T16:12:41Z")

</div>

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

```yaml
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

```yaml
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

---

<div class="post-metadata">

**Author:** ![mstormi](https://community.openhab.org/user_avatar/community.openhab.org/mstormi/32/55857_2.png) [@mstormi](https://community.openhab.org/u/mstormi)\
**Post date:** [November 14, 2021, 7:44pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/2 "2021-11-14T19:44:39Z")

</div>

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](https://www.openhab.org/docs/installation/openhabian.html#auto-backup) 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](https://github.com/openhab/openhabian/blob/main/README.md#a-note-on-dedication-and-commitment) .  
(I’m referring to the third paragraph of the text this link points to)

---

<div class="post-metadata">

**Author:** ![shuo](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shuo](https://community.openhab.org/u/shuo)\
**Post date:** [November 14, 2021, 8:10pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/3 "2021-11-14T20:10:37Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![mstormi](https://community.openhab.org/user_avatar/community.openhab.org/mstormi/32/55857_2.png) [@mstormi](https://community.openhab.org/u/mstormi)\
**Post date:** [November 14, 2021, 9:17pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/4 "2021-11-14T21:17:58Z")

</div>

> [@shuo](#):
>
> high level hints” what I could try?

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.

---

<div class="post-metadata">

**Author:** ![shuo](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shuo](https://community.openhab.org/u/shuo)\
**Post date:** [November 14, 2021, 9:37pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/5 "2021-11-14T21:37:26Z")

</div>

Thanks Markus. Thats what I will do

---

<div class="post-metadata">

**Author:** ![shuo](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shuo](https://community.openhab.org/u/shuo)\
**Post date:** [November 17, 2021, 10:02pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/6 "2021-11-17T22:02:32Z")

</div>

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  
[https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md](https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md) 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?

 ![message](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/9/5/958be6479587f45250db7f2f7550e01f65b41438.png)

---

<div class="post-metadata">

**Author:** ![Wolfgang\_S](https://community.openhab.org/user_avatar/community.openhab.org/wolfgang_s/32/52719_2.png) [@Wolfgang\_S](https://community.openhab.org/u/Wolfgang_S)\
**Post date:** [November 18, 2021, 7:23am UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/7 "2021-11-18T07:23:26Z")

</div>

What is the output of

```php
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.

---

<div class="post-metadata">

**Author:** ![shuo](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shuo](https://community.openhab.org/u/shuo)\
**Post date:** [November 18, 2021, 9:34am UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/8 "2021-11-18T09:34:04Z")

</div>

Hi,  
Installed is 3.2. Exact output:

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

```

.bash\_profile:

```yaml
# ~/.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

```

---

<div class="post-metadata">

**Author:** ![mstormi](https://community.openhab.org/user_avatar/community.openhab.org/mstormi/32/55857_2.png) [@mstormi](https://community.openhab.org/u/mstormi)\
**Post date:** [November 18, 2021, 12:17pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/9 "2021-11-18T12:17:46Z")

</div>

> [@shuo](#):
>
> I guess I am not doing anything wrong. Any clue?

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.

---

<div class="post-metadata">

**Author:** ![shuo](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shuo](https://community.openhab.org/u/shuo)\
**Post date:** [November 18, 2021, 1:08pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/10 "2021-11-18T13:08:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mstormi](https://community.openhab.org/user_avatar/community.openhab.org/mstormi/32/55857_2.png) [@mstormi](https://community.openhab.org/u/mstormi)\
**Post date:** [November 18, 2021, 10:16pm UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/11 "2021-11-18T22:16:07Z")

</div>

> [@shuo](#):
>
> 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

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

> [@shuo](#):
>
> I dont get your point Markus.

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:

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

```

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

> [@shuo](#):
>
> If the above mentioned steps are not needed in general why are they offered? I dont understand

They are needed in different contexts. _Other users_ need it.

---

<div class="post-metadata">

**Author:** ![shuo](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@shuo](https://community.openhab.org/u/shuo)\
**Post date:** [November 19, 2021, 9:57am UTC](https://community.openhab.org/t/openhabian-how-to-recover-boot-partition/128762/12 "2021-11-19T09:57:26Z")

</div>

I will follow your recommendation. Thanks
