openHABian unattended - amanda not installed

  • Platform information:
    • Hardware: Rpi4/4g
    • OS: openHABian Configuration Tool — [openHAB3]{2021-07-28T12:25:04+02:00}(1f4f1ce)
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 3.1.0

as my 2.5.x setup is slowly dying i tried to setup openHAB3 from the latest openHABian (1.6.5) with this openhabian.conf

hostname=ohab3
username=openhabian
userpw="openhabian"
adminkeyurl=""

timezone=Europe/Berlin
locales="en_US.UTF-8 de_DE.UTF-8"
system_default_locale="en_US.UTF-8"

wifi_ssid=""
wifi_password=""

wifi_country=""

ipv6=disable

repositoryurl=https://github.com/openhab/openhabian
clonebranch=main

debugmode=off

cached_java_opt=Zulu11-32
java_opt=Zulu11-32

zraminstall=enable

hotspot=enable
hotspotpw=openhabian

backupdrive=/dev/sda
storageconfig=openhab-dir
storagedir=/storage
storagetapes=15
storagecapacity=7168

adminmail=...
relayuser=...
relaypass=...
smarthost=smtp.gmail.com
smartport=587

as you can see i left debugmode=off
i changed only the parameters hostname, backupdrive, storagecapacity and the “mail-parameters”…
according to the chapter “Auto Backup” from the openhabian unattended installation section setting the backupdrive parameter should setup “disk mirroring PLUS the setup of the Amanda backup system”, right?

the mirroring should’ve worked, i got confirmation via mail:

A timed background job to run semiannually has just created a full raw device copy of your RPI’s internal SD card.
Only partitions to contain openHABian (/boot and / partitions 1 & 2) were copied.

but amanda wasn installed during unattended configuration. first-boot.log:



2021-03-04_23:04:50_UTC [openHABian] Starting the openHABian initial setup.
2021-03-04_23:04:51_UTC [openHABian] Storing configuration... OK
2021-03-04_23:04:51_UTC [openHABian] Starting webserver with installation log... OK
2021-03-04_23:04:56_UTC [openHABian] Changing default username and password... OK
2021-03-04_23:04:56_UTC [openHABian] Setting up Ethernet connection... OK
2021-03-04_23:04:56_UTC [openHABian] Ensuring network connectivity... OK
2021-03-04_23:04:56_UTC [openHABian] Waiting for dpkg/apt to get ready... OK
2021-07-29_11:45:57_UTC [openHABian] Updating repositories and upgrading installed packages... OK
2021-07-29_11:45:57_UTC [openHABian] Installing git package... FAILED
2021-07-29_11:45:57_UTC [openHABian] Updating myself from https://github.com/openhab/openhabian, main branch... OK
2021-07-29_11:45:57_UTC [openHABian] Starting execution of 'openhabian-config unattended'... OK
2021-07-29_11:45:57_UTC [openHABian] Checking for root privileges... OK
2021-07-29_11:45:58_UTC [openHABian] Disabling IPv6... OK
2021-07-29_11:45:58_UTC [openHABian] Updating Linux package information... OK
2021-07-29_11:46:10_UTC [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2021-07-29_11:46:15_UTC [openHABian] Setting timezone based on openhabian.conf... OK (Europe/Berlin)
2021-07-29_13:46:15_CEST [openHABian] Enabling time synchronization using NTP... OK
2021-07-29_13:46:16_CEST [openHABian] Setting locale based on openhabian.conf... OK (reboot required)
2021-07-29_13:46:54_CEST [openHABian] Setting hostname of the base system based on openhabian.conf... OK
2021-07-29_13:46:54_CEST [openHABian] Setting the GPU memory split down to 16MB for headless system... OK
2021-07-29_13:46:54_CEST [openHABian] Enabling Audio output... OK
2021-07-29_13:46:54_CEST [openHABian] Installing basic can't-be-wrong packages (screen, vim, ...)... OK
2021-07-29_13:48:38_CEST [openHABian] Installing additional needed packages... OK
OK
2021-07-29_13:49:57_CEST [openHABian] Installing pigpio package... OK
2021-07-29_13:50:26_CEST [openHABian] Installing additional bluetooth packages... OK
2021-07-29_13:51:51_CEST [openHABian] Adding slightly tuned bash configuration files to system... OK
2021-07-29_13:51:51_CEST [openHABian] Adding slightly tuned vim configuration file to system... OK
2021-07-29_13:51:52_CEST [openHABian] tailscale VPN installation... SKIPPED (no preauthkey defined)
2021-07-29_13:51:52_CEST [openHABian] Applying miscellaneous system settings... OK
2021-07-29_13:51:52_CEST [openHABian] Downloading FireMotD... OK
2021-07-29_13:51:53_CEST [openHABian] Installing FireMotD... OK
2021-07-29_13:51:53_CEST [openHABian] Generating FireMotD theme... OK
2021-07-29_13:52:11_CEST [openHABian] Setting up FireMotD apt updates count service... OK
2021-07-29_13:52:25_CEST [openHABian] Installing cached version of Java to ensure that some form of Java is installed!
2021-07-29_13:52:25_CEST [openHABian] Installing Java Zulu prerequisites (libc, libstdc++, zlib1g)... OK
2021-07-29_13:52:25_CEST [openHABian] Installing Java Zulu 11 32-Bit OpenJDK... OK
2021-07-29_13:52:26_CEST [openHABian] Installing Java Zulu CEK to enable unlimited cipher strength... OK
2021-07-29_13:52:27_CEST [openHABian] Installing Java Zulu prerequisites (libc, libstdc++, zlib1g)... OK
2021-07-29_13:52:27_CEST [openHABian] Downloading Java Zulu 11 32-Bit OpenJDK... OK
2021-07-29_13:53:08_CEST [openHABian] Installing Java Zulu 11 32-Bit OpenJDK... OK
2021-07-29_13:53:11_CEST [openHABian] Installing Java Zulu CEK to enable unlimited cipher strength... OK
2021-07-29_13:53:12_CEST [openHABian] Beginning install of latest openHAB3 release (stable)... OK
2021-07-29_13:53:12_CEST [openHABian] Adding required keys to apt... OK
2021-07-29_13:53:17_CEST [openHABian] Installing selected openHAB3 version... OK
2021-07-29_13:55:04_CEST [openHABian] Setting up openHAB service... OK
2021-07-29_13:55:05_CEST [openHABian] Optimizing openHAB to run on low memory single board computers... OK
2021-07-29_13:55:05_CEST [openHABian] Setting openHAB HTTP/HTTPS ports... OK
2021-07-29_13:55:05_CEST [openHABian] Creating dependencies to jointly start services that depend on each other... OK
2021-07-29_13:55:05_CEST [openHABian] Adding an openHAB dashboard tile for 'openhabiandocs'... OK
2021-07-29_13:55:05_CEST [openHABian] Restarting openHAB service to play it safe... OK
2021-07-29_13:55:06_CEST [openHABian] Adding openHAB syntax to vim editor... OK
2021-07-29_13:55:07_CEST [openHABian] Adding openHAB syntax to nano editor... OK
2021-07-29_13:55:08_CEST [openHABian] Adding openHAB scheme to multitail... OK
2021-07-29_13:55:08_CEST [openHABian] Preparing openHAB folder mounts under '/srv/openhab-*'... OK
2021-07-29_13:55:16_CEST [openHABian] Installing Samba... OK
2021-07-29_13:58:05_CEST [openHABian] Setting up Samba network shares... OK
2021-07-29_13:58:10_CEST [openHABian] Setting up Samba service... OK
2021-07-29_13:58:12_CEST [openHABian] Installing Frontail prerequsites (NodeJS)... OK
2021-07-29_13:59:15_CEST [openHABian] Installing openHAB Log Viewer (frontail)... 2021-07-29_13:59:15_CEST [openHABian] Downloading frontail... OK
OK
2021-07-29_14:00:39_CEST [openHABian] Setting up openHAB Log Viewer (frontail) service... OK
2021-07-29_14:00:40_CEST [openHABian] Adding an openHAB dashboard tile for 'frontail'... OK
2021-07-29_14:00:40_CEST [openHABian] Installing zram... 2021-07-29_14:01:24_CEST [openHABian] Installing MTA required packages (mailutils, exim4, dnsutils)... OK
2021-07-29_14:03:18_CEST [openHABian] Setting up Mail Transfer Agent ... OK
2021-07-29_14:03:18_CEST [openHABian] Adding exim4 to zram service dependencies... OK
2021-07-29_14:03:19_CEST [openHABian] Creating MTA config... OK
2021-07-29_14:03:19_CEST [openHABian] Adding to [...] email to system accounts... OK
2021-07-29_14:03:19_CEST [openHABian] Applying file permissions recommendations... OK
2021-07-29_14:03:21_CEST [openHABian] Setting up automated SD mirroring and backup... OK
Failed to stop storage.mount: Unit storage.mount not loaded.
sfdisk: no disk device specified
Checking that no-one is using this disk right now ... OK

Disk /dev/sda: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Disk model: Storage Device  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc21ed95a

Old situation:

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2         532480 15523839 14991360  7.2G 83 Linux
/dev/sda3       15523840 31116287 15592448  7.4G 83 Linux

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x8764e576.
/dev/sda1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 256 MiB.
Partition #1 contains a vfat signature.
/dev/sda2: Created a new partition 2 of type 'Linux' and of size 7.2 GiB.
Partition #2 contains a ext4 signature.
/dev/sda3: Created a new partition 3 of type 'Linux' and of size 7.4 GiB.
Partition #3 contains a ext4 signature.
/dev/sda4: Done.

New situation:
Disklabel type: dos
Disk identifier: 0x8764e576

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2         532480 15523839 14991360  7.2G 83 Linux
/dev/sda3       15523840 31116287 15592448  7.4G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card
yes: standard output: Broken pipe
OK
OK
OK
2021-07-29_14:14:31_CEST [openHABian] Cleaning up... OK
2021-07-29_14:14:53_CEST [openHABian] Execution of 'openhabian-config unattended' completed.
2021-07-29_14:14:53_CEST [openHABian] First time setup successfully finished. Rebooting your system!
2021-07-29_14:14:53_CEST [openHABian] After rebooting the openHAB dashboard will be available at: http://openhabian:8080
2021-07-29_14:14:53_CEST [openHABian] After rebooting to gain access to a console, simply reconnect using ssh.

the only error that could be relevant may be Installing git package... FAILED but i have no idea which package…

as far as i can see there wasn’t even an attempt to install/configure amanda :face_with_raised_eyebrow:

the parameter storagecapacity=7168 is smaller than the free space on /dev/sda3/ :

openhabian@ohab3:~ $ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    1 14.9G  0 disk
├─sda1        8:1    1  256M  0 part
├─sda2        8:2    1  7.2G  0 part
└─sda3        8:3    1  7.4G  0 part /storage
mmcblk0     179:0    0  7.4G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0  7.2G  0 part /
zram0       254:0    0  600M  0 disk [SWAP]
zram1       254:1    0  900M  0 disk /opt/zram/zram1
zram2       254:2    0  600M  0 disk /opt/zram/zram2

what did i wrong this time? i just changed 3 parameters :frowning:

I think you found a bug. I’ve hopefully fixed this (main branch only).

Try again, this time don’t forget debugmode=maximum

nevermind…
note to self: make sure 2nd card is properly inserted in sd card reader…
i’ll be back…

ok, here i am!

but maybe i didn’t give this part enough attention:

We recommend to put in another card that has at least twice the size of the internal card. We can make use of that extra space as storage for the backup system. Note most “16GB” cards are not exactly 16 GB and your mirror mustn’t have less bytes than the internal one so at setup time, openHABian ensures the second card has at least the same size as your internal card.

i have a 8gb running openHABian and a 16gb for backup (mirroring + amanda) and i assumed that would be more than enough.

but first-boot.log says

+ local 'sizeError=your destination SD card device does not have enough space, it needs to have at least twice as much as the source'

here’s the full log: Untitled - TextBin

paste.bin didn’t let me publish this as public…

i’ve been thinking more on this problem and wanted to check if my 2nd card really isn’t “twice the size of the internal card” :

openhabian@ohab3:~ $ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    1 14.9G  0 disk
├─sda1        8:1    1  256M  0 part
├─sda2        8:2    1  7.2G  0 part
└─sda3        8:3    1  7.4G  0 part /storage
mmcblk0     179:0    0  7.4G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0  7.2G  0 part /
zram0       254:0    0  450M  0 disk [SWAP]
zram1       254:1    0  350M  0 disk /opt/zram/zram1
zram2       254:2    0  450M  0 disk /opt/zram/zram2

partition magic says second sd card = 14,84 GB, internal sd card 7,40GB

and 2 x 7,40 = 14,80 GB and so the second card really is more than twice of the internal card…

:face_with_raised_eyebrow:

Don’t bother speculating. Enable debugmode=maximum and see what it does.
If install bails out, it does not mean it bails out because of SD size.

what am i looking for? there’s so much stuff in first-boot.log…
maybe you could take a look?

have a nice day!

Is that really the log from after I said I patched ?
Check the mirror_SD() function in /opt/openhabian/functions/backup.bash line ~338, does it begin with local src=... ?
That variable is unset so the installation from your log fails in L5078

yes it is/was! i’ve done it again today but obviously with the same results…
i re-downloaded the raspios32 image from here: Releases · openhab/openhabian · GitHub
and let the unattended setup run its way.

/opt/openhabian/functions/backup.bash, line 338/339

mirror_SD() {
  local src="/dev/mmcblk0"
...

so this means the installation fails during the mirroring setup? just wondering… the mirroring part works, while amanda isn’t installed. but that’s probably just because i don’t really know how to read the log file :neutral_face:

The check for remaining space was not in line with the docs. I’m not sure why but I’ve changed that for now. Try again with main branch (start by flashing, no need to re-download the image).

ok, amanda was installed this time!
it still has to make the first backup, but amcheck reports a problem with the “Backup Clients Hosts Check”:

[08:23:51] backup@ohab3:~$ amcheck openhab-dir
Amanda Tape Server Host Check
-----------------------------
slot 1: contains an empty volume
Will write label 'openhab-dir-01' to new volume in slot 1.
NOTE: skipping tape-writable test
NOTE: host info dir '/var/lib/amanda/openhab-dir/curinfo/openhabian' does not exist
      It will be created on the next run
NOTE: index dir '/var/lib/amanda/openhab-dir/index/openhabian' does not exist
      it will be created on the next run
Server check took 1.044 seconds
Amanda Backup Client Hosts Check
--------------------------------
ERROR: openhabian: selfcheck request failed: resolve_hostname(openhabian): No address associated with hostname
Client check: 1 host checked in 13.538 seconds.  1 problem found.

i changed the hostname in the openhabian.conf so i guess it makes sense that resolve_hostname(openhabian) doesn’t return a valid address. is the Backup Client Hosts Check relevant or can i just ignore this part? didn’t find anything on the openhabian-amanda page…

thanks for the help, have a nice day/week!

I don’t know. This is out of scope of openHABian. G**gle to find out and tell us.

looks like this is relevant. couldn’t find the parameter “hostname” in /etc/amanda/openhab-dir/amanda.conf and changing /etc/amandahosts also didn’t help.

[12:15:14] backup@ohab3:~$ amreport openhab-dir
Hostname: ohab3
Org     : openHABian openhab-dir
Config  : openhab-dir
Date    : August 3, 2021

The next 10 tapes Amanda expects to use are: 10 new tapes.


FAILURE DUMP SUMMARY:
  planner: ERROR Request to openhabian failed: resolve_hostname(openhabian): No address associated with hostname
  openhabian /boot lev 0  FAILED [Request to openhabian failed: resolve_hostname(openhabian): No address associated with hostname]
  openhabian /etc lev 0  FAILED [Request to openhabian failed: resolve_hostname(openhabian): No address associated with hostname]
  openhabian /var/lib/openhab lev 0  FAILED [Request to openhabian failed: resolve_hostname(openhabian): No address associated with hostname]

used in disklist maybe ?
Check the logs in /var/log/amanda

yes, thank you!

Did you change it before the install ?

yes, i set the hostname parameter in openhabian.conf before i put the sd card in my raspberry pi (for unattended setup).

has something changed with the unattended setup?

(my setup crashed today, after i mirrored from backup i was able to boot once but as i had problems installing mosquitto from openhabian-config i made another reboot and afterwards i couldn’t reach the device anymore.)

so i wrote the openhabian image to my sd card again (with openhabian.conf settings still as mentioned in the first post of this thread) but not amanda was NOT installed (again).

here is the full first-boot.log: Untitled - TextBin
and here is part of the log where an error appeared.

+ setup_mirror_SD install
+ cond_redirect install -m 755 /set-partuuid /usr/local/sbin
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ install -m 755 /set-partuuid /usr/local/sbin \033[39;49;00m'

e[90;01m$ install -m 755 /set-partuuid /usr/local/sbin e[39;49;00m
+ install -m 755 /set-partuuid /usr/local/sbin
install: cannot stat '/set-partuuid': No such file or directory
+ return 1
+ echo 'FAILED (install set-partuuid)'
FAILED (install set-partuuid)
+ return 1

i have reactivated my old (not fully working) OH2 system again but i’d like to make another attempt to get this thing working :frowning:

It’s constantly changing. But your issue is because you have hit a bad moment in time. Try again.

1 Like

looks good, thanks!