Openhabian Config: Move to USB not working

I am on stable branch 2.5.5 and tried to move root to USB, which was working last time well. Now I got the following message:

In addition I see some messages talking about failed updates:

[07:23:36] openhabian@openhab:~$ sudo openhabian-config
[sudo] Passwort für openhabian:
2020-06-16_07:28:01_CEST [openHABian] Checking for root privileges... OK
2020-06-16_07:28:01_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2020-06-16_07:28:03_CEST [openHABian] openHABian configuration tool version: [stable]v1.5-644(e01719a)
2020-06-16_07:28:03_CEST [openHABian] Checking for changes in origin branch HEAD ... OK
2020-06-16_07:28:05_CEST [openHABian] Switching to branch  ... fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths
FAILED
2020-06-16_07:28:10_CEST [openHABian] Updating Linux package information ...
FAILED
2020-06-16_07:29:03_CEST [openHABian] Checking for default openHABian username:password combination... OK

While starting openhabian-config no updates are available, but in the last couple of days tons of inserts and deletions have been received, so maybe something went wrong.

Is there a way to force update?

menu 01
But if it does not offer upgrading on start there’s nothing to upgrade to.

You could also switch to master and set debugmode=maximum in /etc/openhabian.conf to see more.

Hello,
I have the same error. I have tried a clean new installation, but have the same error.
Now I switch to master and add debug logging.

[10:01:28] openhabian@openhab:~$ sudo openhabian-config
[sudo] password for openhabian:
2020-06-24_10:01:37_CEST [openHABian] Checking for root privileges… OK

  • export UNATTENDED SILENT DEBUGMAX INTERACTIVE

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/backup.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/config.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/ext-storage.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/helpers.bash
    ++ ESC=’\033[’
    ++ COL_DEF=’\033[39;49;00m’
    ++ COL_RED=’\033[31;01m’
    ++ COL_GREEN=’\033[32;01m’
    ++ COL_YELLOW=’\033[33;01m’
    ++ COL_BLUE=’\033[34;01m’
    ++ COL_MAGENTA=’\033[35;01m’
    ++ COL_CYAN=’\033[36;01m’
    ++ COL_LGRAY=’\033[37;01m’
    ++ COL_DGRAY=’\033[90;01m’
    ++ export COL_DEF COL_RED COL_GREEN COL_YELLOW COL_BLUE COL_MAGENTA COL_CYAN COL_LGRAY COL_DGRAY

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/influxdb+grafana.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/java-jre.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/menu.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/nodejs-apps.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/openhab.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/openhabian.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/packages.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/passwords.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/system.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/wifi.bash

  • for shfile in “$BASEDIR”/functions/*.bash

  • source /opt/openhabian/functions/zram.bash
    ++ pwd

  • OLDWD=/home/openhabian

  • cd /opt

  • choose_ipv6

  • local IPV6_DISABLE=net.ipv6.conf.all.disable_ipv6

  • [[ ‘’ == \d\i\s\a\b\l\e ]]

  • [[ ‘’ == \e\n\a\b\l\e ]]

  • sysctl -p

  • [[ -n ‘’ ]]

  • apt_update

  • PID_APT=1295

  • whiptail_check

  • command -v whiptail

  • apt-get -q update

  • load_create_config

  • ‘[’ -f /etc/openhabian.conf ‘]’
    ++ timestamp
    ++ date +%F_%T_%Z

  • echo -n ‘2020-06-24_10:01:37_CEST [openHABian] Loading configuration file ‘’’/etc/openhabian.conf’’’… ’
    2020-06-24_10:01:37_CEST [openHABian] Loading configuration file ‘/etc/openhabian.conf’… + source /etc/openhabian.conf
    ++ hostname=openhab
    ++ username=openhabian
    ++ timeserver=0.pool.ntp.org
    ++ locales=‘en_US.UTF-8 de_DE.UTF-8’
    ++ system_default_locale=en_US.UTF-8
    ++ wifi_ssid=
    ++ wifi_psk=
    ++ wifi_country=
    ++ debugmode=maximum

  • echo OK
    OK

  • ua-netinst_check

  • ‘[’ -f /boot/config-reinstall.txt ‘]’

  • openhabian_console_check
    ++ tput cols

  • ‘[’ 237 -lt 120 ‘]’

  • openhabian_update_check

  • local branch

  • local ‘introtext=Additions, improvements or fixes were added to the openHABian configuration tool. Would you like to update now and benefit from them? The update will not automatically apply changes to your system.\n\nUpdating is recommended.’

  • local ‘unsupportedhwtext=You are running on old hardware that is no longer officially supported.\nopenHABian may still work with this or not.\nWe recommend to replace your hardware with a current SBC such as a RPi4/2GB.\nDo you really want to continue using openHABian on this system ?’

  • local ‘unsupportedostext=You are running an old Linux release that is no longer officially supported.\nWe recommend upgrading to the most current stable release of your distribution (or current Long Term Support version for distributions to offer LTS).\nDo you really want to continue using openHABian on this system ?’

  • is_pine64
    ++ uname -r

  • [[ 4.19.118-v7l+ =~ pine64-longsleep ]]

  • return 1

  • is_jessie

  • [[ ‘’ == \j\e\s\s\i\e ]]
    ++ cat /etc/os-release

  • [[ PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”
    NAME=“Raspbian GNU/Linux”
    VERSION_ID=“10”
    VERSION=“10 (buster)”
    VERSION_CODENAME=buster
    ID=raspbian
    ID_LIKE=debian

  • return 1

  • is_xenial

  • [[ ‘’ == \x\e\n\i\a\l ]]
    ++ cat /etc/os-release

  • [[ PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”
    NAME=“Raspbian GNU/Linux”
    VERSION_ID=“10”
    VERSION=“10 (buster)”
    VERSION_CODENAME=buster
    ID=raspbian
    ID_LIKE=debian

  • return 1

  • FAILED=0
    ++ timestamp
    ++ date +%F_%T_%Z
    ++ get_git_revision
    ++ local branch shorthash revcount latesttag
    +++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
    ++ branch=master
    +++ git -C /opt/openhabian log --pretty=format:%h -n 1
    ++ shorthash=193d26d
    +++ git -C /opt/openhabian log --oneline
    +++ wc -l
    ++ revcount=674
    +++ git -C /opt/openhabian describe --tags --abbrev=0
    ++ latesttag=v1.5
    ++ echo ‘[master]v1.5-674(193d26d)’

  • echo ‘2020-06-24_10:01:37_CEST [openHABian] openHABian configuration tool version: [master]v1.5-674(193d26d)’
    2020-06-24_10:01:37_CEST [openHABian] openHABian configuration tool version: [master]v1.5-674(193d26d)

  • branch=HEAD
    ++ timestamp
    ++ date +%F_%T_%Z

  • echo -n '2020-06-24_10:01:37_CEST [openHABian] Checking for changes in origin branch HEAD … ’
    2020-06-24_10:01:37_CEST [openHABian] Checking for changes in origin branch HEAD … + git -C /opt/openhabian config user.email openhabian@openHABian

  • git -C /opt/openhabian config user.name openhabian

  • git -C /opt/openhabian fetch --quiet origin
    ++ git -C /opt/openhabian rev-parse HEAD
    ++ git -C /opt/openhabian rev-parse ‘@{u}’

  • ‘[’ 193d26d4039ee72ce27193a8d19ae9170f70b5f5 == 193d26d4039ee72ce27193a8d19ae9170f70b5f5 ‘]’

  • echo OK
    OK

  • openhabian_announcements

  • local newsfile=/opt/openhabian/NEWS.md

  • local readnews=/opt/openhabian/docs/LASTNEWS.md

  • [[ -z 1 ]]

  • diff -q /opt/openhabian/NEWS.md /opt/openhabian/docs/LASTNEWS.md
    ++ timestamp
    ++ date +%F_%T_%Z

  • echo -n '2020-06-24_10:01:38_CEST [openHABian] Switching to branch … ’
    2020-06-24_10:01:38_CEST [openHABian] Switching to branch … + git -C /opt/openhabian checkout --quiet ‘’
    fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths

  • FAILED=1

  • echo FAILED
    FAILED

  • return 0

  • show_main_menu
    +++ get_git_revision
    +++ local branch shorthash revcount latesttag
    ++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
    +++ branch=master
    ++++ git -C /opt/openhabian log --pretty=format:%h -n 1
    +++ shorthash=193d26d
    ++++ git -C /opt/openhabian log --oneline
    ++++ wc -l
    +++ revcount=674
    ++++ git -C /opt/openhabian describe --tags --abbrev=0
    +++ latesttag=v1.5
    +++ echo ‘[master]v1.5-674(193d26d)’
    ++ whiptail --title ‘Welcome to the openHABian Configuration Tool [master]v1.5-674(193d26d)’ --menu ‘Setup Options’ 20 116 13 --cancel-button Exit --ok-button Execute ‘00 | About openHABian’ ‘Information about the openHABian project and this tool’ ‘’ ‘’ ‘01 | Select Branch’ ‘Select the openHABian config tool version (“branch”) to run’ ‘02 | Upgrade System’ ‘Upgrade all installed software packages (incl. openHAB) to their latest version’ ‘03 | openHAB Stable’ ‘Install or upgrade to the latest stable release of openHAB 2’ ‘’ ‘’ ‘10 | Apply Improvements’ ‘Apply the latest improvements to the basic openHABian setup ►’ ‘20 | Optional Components’ ‘Choose from a set of optional software components ►’ ‘30 | System Settings’ ‘A range of system and hardware related configuration steps ►’ ‘40 | openHAB related’ ‘Switch the installed openHAB version or apply tweaks ►’ ‘50 | Backup/Restore’ ‘Manage backups and restore your system ►’ ‘’ ‘’ ‘60 | Manual/Fresh Setup’ ‘Go through all openHABian setup steps manually ►’

  • choice=‘30 | System Settings’

  • RET=0

  • ‘[’ 0 -eq 1 ‘]’

  • ‘[’ 0 -eq 255 ‘]’

  • [[ 30 | System Settings == ‘’ ]]

  • [[ 30 | System Settings == \0\0* ]]

  • [[ 30 | System Settings == \0\1* ]]

  • [[ 30 | System Settings == \0\2* ]]

  • [[ 30 | System Settings == \0\3* ]]

  • [[ 30 | System Settings == \1\0* ]]

  • [[ 30 | System Settings == \2\0* ]]

  • [[ 30 | System Settings == \3\0* ]]
    +++ get_git_revision
    +++ local branch shorthash revcount latesttag
    ++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
    +++ branch=master
    ++++ git -C /opt/openhabian log --pretty=format:%h -n 1
    +++ shorthash=193d26d
    ++++ git -C /opt/openhabian log --oneline
    ++++ wc -l
    +++ revcount=674
    ++++ git -C /opt/openhabian describe --tags --abbrev=0
    +++ latesttag=v1.5
    +++ echo ‘[master]v1.5-674(193d26d)’
    +++ hostname
    +++ env
    +++ grep LANG=
    +++ sed s/LANG=//
    +++ date +%H:%M
    ++ whiptail --title ‘Welcome to the openHABian Configuration Tool [master]v1.5-674(193d26d)’ --menu ‘Setup Options’ 16 116 9 --cancel-button Back --ok-button Execute ‘31 | Change hostname ’ ‘Change the name of this system, currently ‘’‘openhab’’’’ ‘32 | Set system locale’ ‘Change system language, currently ‘’‘en_US.UTF-8’’’’ ‘33 | Set system timezone’ ‘Change the your timezone, execute if it’’‘s not ‘’‘10:01’’’ now’ ‘34 | Change passwords’ ‘Change passwords for Samba, openHAB Console or the system user’ ‘35 | Serial port’ ‘Prepare serial ports for peripherals like Razberry, SCC, Pine64 ZWave, …’ ‘36 | WiFi setup’ ‘Configure wireless network connection’ ‘37 | Move root to USB’ ‘Move the system root from the SD card to a USB device (SSD or stick)’ ‘38 | Use ZRAM’ ‘Use compressed RAM/disk sync for active directories to avoid SD card corruption’ ’ | Uninstall ZRAM’ ‘Don’’‘t use compressed memory (back to standard Raspberry Pi OS filesystem layout)’

  • choice2=‘37 | Move root to USB’

  • ‘[’ 0 -eq 1 ‘]’

  • ‘[’ 1 -eq 255 ‘]’

  • wait_for_apt_to_finish_update
    ++ timestamp
    ++ date +%F_%T_%Z

  • echo -n '2020-06-24_10:01:47_CEST [openHABian] Updating Linux package information … ’
    2020-06-24_10:01:47_CEST [openHABian] Updating Linux package information … + ‘[’ -z 1295 ‘]’

  • timeout 60 tail --pid=1295 -f /dev/null

  • echo OK
    OK

  • case “$choice2” in

  • move_root2usb

  • NEWROOTDEV=/dev/sda

  • NEWROOTPART=/dev/sda1

  • infotext=‘DANGEROUS OPERATION, USE WITH PRECAUTION!\n\nThis will move your system root from your SD card to a USB device like an SSD or a USB stick.\nATTENTION: this is NOT the recommended method to reduce wearout and failure of the SD card. If that is your intention, stop here and go for ZRAM (menu option 38).\n\nIf you still want to proceed,\n1.) Ensure your RPi model can boot from a device other than the internal SD card reader.\n2.) Make a backup of your SD card\n3.) Remove all USB mass storage devices from your Pi\n4.) Insert the USB device to be used for the new system root.\n\nTHIS DEVICE WILL BE COMPLETELY DELETED\n\nDo you want to continue at your own risk?’

  • is_pi

  • is_pizero

  • [[ ‘’ == \p\i\0 ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]09[0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_pizerow

  • [[ ‘’ == \p\i\0\w ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[cC][0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_pione

  • [[ ‘’ == \p\i\1 ]]

  • grep -q ‘^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$’ /proc/cpuinfo

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[0-36][0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_cmone

  • [[ ‘’ == \c\m\1 ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]06[0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_pitwo

  • [[ ‘’ == \p\i\2 ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]04[0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_pithree

  • [[ ‘’ == \p\i\3 ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]08[0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_cmthree

  • [[ ‘’ == \c\m\3 ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[aA][0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_pithreeplus

  • [[ ‘’ == \p\i\3+ ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[dDeE][0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_cmthreeplus

  • [[ ‘’ == \c\m\3+ ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]10[0-9a-fA-F]$’ /proc/cpuinfo

  • return 1

  • is_pifour

  • [[ ‘’ == \p\i\4 ]]

  • grep -q ‘^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$’ /proc/cpuinfo

  • return 0

  • return 0

  • ‘[’ -f /etc/ztab ‘]’

  • whiptail --title ‘Move system root to ‘’’/dev/sda1’’’’ --yes-button Continue --no-button Back --yesno ‘DANGEROUS OPERATION, USE WITH PRECAUTION!\n\nThis will move your system root from your SD card to a USB device like an SSD or a USB stick.\nATTENTION: this is NOT the recommended method to reduce wearout and failure of the SD card. If that is your intention, stop here and go for ZRAM (menu option 38).\n\nIf you still want to proceed,\n1.) Ensure your RPi model can boot from a device other than the internal SD card reader.\n2.) Make a backup of your SD card\n3.) Remove all USB mass storage devices from your Pi\n4.) Insert the USB device to be used for the new system root.\n\nTHIS DEVICE WILL BE COMPLETELY DELETED\n\nDo you want to continue at your own risk?’ 22 116

  • rootonsdcard=false
    ++ sed ‘s/.root=([a-zA-Z0-9/=-])(.*)/\1/’

  • rootpart=PARTUUID=a78491f2-02

  • [[ PARTUUID=a78491f2-02 == \P\A\R\T\U\U\I\D= ]]

  • blkid -l -t PARTUUID=a78491f2-02

  • grep -q /dev/mmcblk0p2

  • rootonsdcard=true

  • ‘[’ true = true ‘]’

  • [[ -b /dev/sda1 ]]
    ++ blockdev --getsize64 /dev/mmcblk0

  • srcsize=63864569856
    ++ blockdev --getsize64 /dev/sda

  • destsize=120034123776

  • [[ 63864569856 -gt 120034123776 ]]

  • exit 1

  1. Use code fences !

  2. have you read about ZRAM. Move to USB rarely is a good idea. Code also is untested probably in years and not validated on recent HW.

  3. I applied a fix. Update and retry.

1 Like

Great work it works!
Many Thanks!!! :ok_hand: :+1: :+1: :+1: :+1: :+1: