Openhab won't start after moving root to mSATA

[12:41:49] openhabian@openHABianPi:/var/log/openhab2$ java -version
openjdk version "1.8.0_152"
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
  • openHAB version: 2.3.0-1
  • Issue of the topic: I have installed openhabian on a micro SD card in a raspberry pi 2B; openhab starts fine in this configuration. After installation, I used openhabian-config to move the root to an external SSD (a 102GB mSATA SSD connected using a Lycom PI-102 hat for the pi). After rebooting, openhabian no longer starts. I think I’ve ruled out power supply issues for the mSATA and similar problems - the drive is mounted rw and I can write files to it etc. My issue seems similar to this one, but I’m not using an orange pi.
  • Please post configurations (if applicable):

Configuration files:
The only configuration file I changed on the working version (SD card) before moving the root to the SSD was addons.cfg:

[12:04:03] openhabian@openHABianPi:/etc/openhab2$ cat services/addons.cfg 
# The installation package of this openHAB instance
# Note: This is only regarded at the VERY FIRST START of openHAB
# Note: If you want to specify your add-ons yourself through entries below, set the package to "minimal"
# as otherwise your definition might be in conflict with what the installation package defines.
#
# Optional. If not set, the dashboard (https://<yourserver>:8080/) will ask you to choose a package.
#
# Valid options:
#   - minimal  : Installation only with dashboard, but no UIs or other add-ons. Use this for custom setups.
#   - simple   : Setup for using openHAB purely through UIs - you need to expect MANY constraints in functionality!
#   - standard : Default setup for normal users, best for textual setup
#   - expert   : Setup for expert users, especially for people migrating from openHAB 1.x
#   - demo     : A demo setup which includes UIs, a few bindings, config files etc.
#
# See https://www.openhab.org/docs/configuration/packages.html for a detailed explanation of these packages.
#
package = standard

# Access Remote Add-on Repository
# Defines whether the remote openHAB add-on repository should be used for browsing and installing add-ons.
# This not only makes latest snapshots of add-ons available, it is also required for the installation of
# any legacy 1.x add-on. (default is true)
#
remote = true

# Include legacy 1.x bindings. If set to true, it also allows the installation of 1.x bindings for which there is 
# already a 2.x version available (requires remote repo access, see above). (default is false)
#
legacy = true

# A comma-separated list of bindings to install (e.g. "binding = sonos,knx,zwave")
binding = mqtt1

# A comma-separated list of UIs to install (e.g. "ui = basic,paper")
#ui = 

# A comma-separated list of persistence services to install (e.g. "persistence = rrd4j,jpa")
persistence = mapdb,influxdb

# A comma-separated list of actions to install (e.g. "action = mail,pushover")
#action = 

# A comma-separated list of transformation services to install (e.g. "transformation = map,jsonpath")
transformation = map,jsonpath

# A comma-separated list of voice services to install (e.g. "voice = marytts,freetts")
#voice = 

# A comma-separated list of miscellaneous services to install (e.g. "misc = myopenhab")
#misc =

So my config files look like:

[12:04:00] openhabian@openHABianPi:/etc/openhab2$ tree -ugp  
.
├── [drwxrwxr-x openhab  openhabian]  html
│   ├── [-rw-rw-r-- openhab  openhabian]  index.html
│   └── [-rw-rw-r-- openhab  openhabian]  readme.txt
├── [drwxrwxr-x openhab  openhabian]  icons
│   └── [drwxrwxr-x openhab  openhabian]  classic
│       └── [-rw-rw-r-- openhab  openhabian]  readme.txt
├── [drwxrwxr-x openhab  openhabian]  items
│   └── [-rw-rw-r-- openhab  openhabian]  readme.txt
├── [drwxrwxr-x openhab  openhabian]  persistence
│   └── [-rw-rw-r-- openhab  openhabian]  readme.txt
├── [drwxrwxr-x openhab  openhabian]  rules
│   └── [-rw-rw-r-- openhab  openhabian]  readme.txt
├── [drwxrwxr-x openhab  openhabian]  scripts
│   └── [-rw-rw-r-- openhab  openhabian]  readme.txt
├── [drwxrwxr-x openhab  openhabian]  services
│   ├── [-rw-rw-r-- openhab  openhabian]  addons.cfg
│   ├── [-rw-rw-r-- openhab  openhabian]  dashboard.cfg
│   ├── [-rw-rw-r-- openhab  openhab ]  influxdb.cfg
│   ├── [-rw-rw-r-- openhab  openhab ]  mapdb.cfg
│   ├── [-rw-rw-r-- openhab  openhab ]  mqtt.cfg
│   ├── [-rw-rw-r-- openhab  openhab ]  mqtt-eventbus.cfg
│   ├── [-rw-rw-r-- openhab  openhabian]  readme.txt
│   └── [-rw-rw-r-- openhab  openhabian]  runtime.cfg
├── [drwxrwxr-x openhab  openhabian]  sitemaps
│   └── [-rw-rw-r-- openhab  openhabian]  readme.txt
├── [drwxrwxr-x openhab  openhabian]  sounds
│   ├── [-rw-rw-r-- openhab  openhabian]  barking.mp3
│   └── [-rw-rw-r-- openhab  openhabian]  doorbell.mp3
├── [drwxrwxr-x openhab  openhabian]  things
│   └── [-rw-rw-r-- openhab  openhabian]  readme.txt
└── [drwxrwxr-x openhab  openhabian]  transform
    ├── [-rw-rw-r-- openhab  openhabian]  de.map
    ├── [-rw-rw-r-- openhab  openhabian]  en.map
    └── [-rw-rw-r-- openhab  openhabian]  readme.txt

Should the auto-generated ones like influxdb.cfg have group openhabian?

  • If logs where generated please post these here using code fences:
[12:15:33] openhabian@openHABianPi:/etc/openhab2$ sudo journalctl -u karaf -u openhab2
Aug 21 12:14:44 openHABianPi systemd[1]: Started openHAB 2 - empowering the smart home.
Aug 21 12:14:46 openHABianPi karaf[26634]: /usr/share/openhab2/runtime/bin/karaf: 91: [: Illegal number:
Aug 21 12:14:48 openHABianPi karaf[26634]: null
Aug 21 12:14:48 openHABianPi karaf[26634]: Error occurred shutting down framework: java.lang.NumberFormatException: null
Aug 21 12:14:48 openHABianPi karaf[26634]: java.lang.NumberFormatException: null
Aug 21 12:14:48 openHABianPi karaf[26634]:         at java.lang.Integer.parseInt(Integer.java:542)
Aug 21 12:14:48 openHABianPi systemd[1]: openhab2.service: Main process exited, code=exited, status=254/n/a
Aug 21 12:14:50 openHABianPi karaf[26762]: /usr/share/openhab2/runtime/bin/karaf: 91: [: Illegal number:
Aug 21 12:14:51 openHABianPi karaf[26762]: Exception in thread "main" java.lang.NumberFormatException: null
Aug 21 12:14:51 openHABianPi karaf[26762]:         at java.lang.Integer.parseInt(Integer.java:542)
Aug 21 12:14:51 openHABianPi karaf[26762]:         at java.lang.Integer.parseInt(Integer.java:615)
Aug 21 12:14:51 openHABianPi karaf[26762]:         at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:214
Aug 21 12:14:51 openHABianPi karaf[26762]:         at org.apache.karaf.main.Stop.main(Stop.java:44)
Aug 21 12:14:51 openHABianPi systemd[1]: openhab2.service: Control process exited, code=exited status=1
Aug 21 12:14:51 openHABianPi systemd[1]: openhab2.service: Unit entered failed state.
Aug 21 12:14:51 openHABianPi systemd[1]: openhab2.service: Failed with result 'exit-code'.
Aug 21 12:14:56 openHABianPi systemd[1]: openhab2.service: Service hold-off time over, scheduling restart.
Aug 21 12:14:56 openHABianPi systemd[1]: Stopped openHAB 2 - empowering the smart home.

Any ideas? I have repeated this process twice and get the same result each time.

I also have a raspberry pi B (not 2B) running openhab quite happily, but I want to move over to the 2B because openhab is really slow on the B, and the SD card is bound to get corrupted with all the persistence data I’m logging.

You may need to edit your /boot/config.txt file and add a line to allow max power to the USB. If you dont have the line

max_usb_current=1

in the /boot/config.txt then add it and reboot.

You can try manually following this tutorial: https://community.openhab.org/t/raspi-2-move-system-root-to-usb-ssd/15243?u=h102

I find the Openhabian Script to move it to an External drive a bit finicky.

Have you tried just burning the image directly to the mSATA? I believe the rPi2B supports the ability to change the bootmode. Only the rPi and rPi2 don’t support the USB bootmode.

Thanks for the response, I mentioned in the OP that I think I have ruled out power supply issues - I’m using an official universal 2.5A power supply, I can write to the drive, and no other services are throwing errors. If I deliberately use a power supply that I know is insufficient then the pi doesn’t boot all the way up.

I have that max usb current parameter in config.txt (the openhabian-config script adds it).

Sam

Aren’t all Pi 2s 2Bs? I don’t think there is such a thing as a 2A.

As far as I can tell, booting directly from an external drive (without SD card) is only supported from v3 and above.

From what I have read you are correct.

I used the tutorial, that I posted above, on a RPI2 B to move OH onto a flash drive with no issues. I never tried using the openhabian-config tool. Maybe give the manual way a shot or read over the tutorial and verify the file system is correct.

I’ve since bought a RPI3 B+ and run OH on just an SSD 128G hard drive and use the other RPI for Pi Hole.

I have a couple rPi2s the naming convention always confused me because there were a couple revisions and I know the later ones do support the Boot from USB function I think they were 2B+ vs 2B. If you have the BCM2837 (which the later rPi2 came with) it’ll work out of the box.

https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/ there’s also this to enable other bootmodes on older Pi.


Confusing naming convention.

[16:42:38] openhabian@openHABianPi:~$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 2
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 3
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

Hardware        : BCM2835
Revision        : a01041
Serial          : 000000007092d77f

Based on this info:
https://www.element14.com/community/community/raspberry-pi/blog/2016/11/21/how-to-identify-which-model-of-the-raspberry-pi-you-have

It’s a pi 2 model B v 1.1, so unfortunately I can’t boot straight from the SSD.