Testing auto backup

Tags: #<Tag:0x00007f616f8d30d8>

tried to install this via openhabian-config but after confirming menu entry 53 i only get this message:

There was an error or interruption during the execution of:
“50 | Backup/Restore”
Please try again. If the error persists, please read
/opt/openhabian/docs/openhabian-DEBUG.md or
https://github.com/openhab/openhabian/blob/master/docs/openhabian-DEBUG.md
how to proceed.

in the background i have the following output:

+ choice2='53 | Setup SD mirroring'
+ '[' 0 -eq 1 ']'
+ '[' 1 -eq 255 ']'
+ case "$choice2" in
+ setup_mirror_SD install
+ local dest
+ local srcSize
+ local destSize
+ local minSize
+ local targetDir=/etc/systemd/system/
+ local storageDir=/storage
+ local 'sizeError=your destination SD card device does not have enough space, it needs to have at least twice as much a                                                                                                  s the source'
+ local 'infoText1=DANGEROUS OPERATION, USE WITH PRECAUTION!\n\nThis will *copy* your system root from your SD card to a                                                                                                   USB attached card writer device. Are you sure'
+ local 'infoText2=is an SD card writer device equipped with a dispensible SD card ? Are you this will destroy all data                                                                                                   on that card and you want to proceed writing to this device ?'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2020-09-15_19:45:03_CEST [openHABian] Setting up automated SD mirroring and backup... '
2020-09-15_19:45:03_CEST [openHABian] Setting up automated SD mirroring and backup... + [[ install == \r\e\m\o\v\e ]]
+ [[ install != \i\n\s\t\a\l\l ]]
+ 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
+ [[ -n '' ]]
+ [[ -n 1 ]]
+ select_blkdev '^sd' 'Setup SD mirroring' 'Select USB device to copy the internal SD card data to'
+ [[ -z 1 ]]
+ array=()
+ declare -a array
+ read -r id foo foo size foo foo foo
++ lsblk -i
++ tr -d '`\\|'
++ tr -d '\\-'
++ grep -E '^sd'
++ whiptail --title 'Setup SD mirroring' --cancel-button Cancel --ok-button Select --menu 'Select USB device to copy the                                                                                                   internal SD card data to' 12 76 4
+ retval='Box options:
        --msgbox <text> <height> <width>
        --yesno  <text> <height> <width>
        --infobox <text> <height> <width>
        --inputbox <text> <height> <width> [init]
        --passwordbox <text> <height> <width> [init]
        --textbox <file> <height> <width>
        --menu <text> <height> <width> <listheight> [tag item] ...
        --checklist <text> <height> <width> <listheight> [tag item status]...
        --radiolist <text> <height> <width> <listheight> [tag item status]...
        --gauge <text> <height> <width> <percent>
Options: (depend on box-option)
        --clear                         clear screen on exit
        --defaultno                     default no button
        --default-item <string>         set default string
        --fb, --fullbuttons             use full buttons
        --nocancel                      no cancel button
        --yes-button <text>             set text of yes button
        --no-button <text>              set text of no button
        --ok-button <text>              set text of ok button
        --cancel-button <text>          set text of cancel button
        --noitem                        don'\''t display items
        --notags                        don'\''t display tags
        --separate-output               output one line at a time
        --output-fd <fd>                output to fd, not stdout
        --title <title>                 display title
        --backtitle <backtitle>         display backtitle
        --scrolltext                    force vertical scrollbars
        --topleft                       put window in top-left corner
        -h, --help                      print this message
        -v, --version                   print version information'
+ [[ -z Box options:
        --msgbox <text> <height> <width>
        --yesno  <text> <height> <width>
        --infobox <text> <height> <width>
        --inputbox <text> <height> <width> [init]
        --passwordbox <text> <height> <width> [init]
        --textbox <file> <height> <width>
        --menu <text> <height> <width> <listheight> [tag item] ...
        --checklist <text> <height> <width> <listheight> [tag item status]...
        --radiolist <text> <height> <width> <listheight> [tag item status]...
        --gauge <text> <height> <width> <percent>
Options: (depend on box-option)
        --clear                         clear screen on exit
        --defaultno                     default no button
        --default-item <string>         set default string
        --fb, --fullbuttons             use full buttons
        --nocancel                      no cancel button
        --yes-button <text>             set text of yes button
        --no-button <text>              set text of no button
        --ok-button <text>              set text of ok button
        --cancel-button <text>          set text of cancel button
        --noitem                        don't display items
        --notags                        don't display tags
        --separate-output               output one line at a time
        --output-fd <fd>                output to fd, not stdout
        --title <title>                 display title
        --backtitle <backtitle>         display backtitle
        --scrolltext                    force vertical scrollbars
        --topleft                       put window in top-left corner
        -h, --help                      print this message
        -v, --version                   print version information ]]
+ dest='/dev/Box options:
        --msgbox <text> <height> <width>
        --yesno  <text> <height> <width>
        --infobox <text> <height> <width>
        --inputbox <text> <height> <width> [init]
        --passwordbox <text> <height> <width> [init]
        --textbox <file> <height> <width>
        --menu <text> <height> <width> <listheight> [tag item] ...
        --checklist <text> <height> <width> <listheight> [tag item status]...
        --radiolist <text> <height> <width> <listheight> [tag item status]...
        --gauge <text> <height> <width> <percent>
Options: (depend on box-option)
        --clear                         clear screen on exit
        --defaultno                     default no button
        --default-item <string>         set default string
        --fb, --fullbuttons             use full buttons
        --nocancel                      no cancel button
        --yes-button <text>             set text of yes button
        --no-button <text>              set text of no button
        --ok-button <text>              set text of ok button
        --cancel-button <text>          set text of cancel button
        --noitem                        don'\''t display items
        --notags                        don'\''t display tags
        --separate-output               output one line at a time
        --output-fd <fd>                output to fd, not stdout
        --title <title>                 display title
        --backtitle <backtitle>         display backtitle
        --scrolltext                    force vertical scrollbars
        --topleft                       put window in top-left corner
        -h, --help                      print this message
        -v, --version                   print version information'
++ blockdev --getsize64 '/dev/Box options:
        --msgbox <text> <height> <width>
        --yesno  <text> <height> <width>
        --infobox <text> <height> <width>
        --inputbox <text> <height> <width> [init]
        --passwordbox <text> <height> <width> [init]
        --textbox <file> <height> <width>
        --menu <text> <height> <width> <listheight> [tag item] ...
        --checklist <text> <height> <width> <listheight> [tag item status]...
        --radiolist <text> <height> <width> <listheight> [tag item status]...
        --gauge <text> <height> <width> <percent>
Options: (depend on box-option)
        --clear                         clear screen on exit
        --defaultno                     default no button
        --default-item <string>         set default string
        --fb, --fullbuttons             use full buttons
        --nocancel                      no cancel button
        --yes-button <text>             set text of yes button
        --no-button <text>              set text of no button
        --ok-button <text>              set text of ok button
        --cancel-button <text>          set text of cancel button
        --noitem                        don'\''t display items
        --notags                        don'\''t display tags
        --separate-output               output one line at a time
        --output-fd <fd>                output to fd, not stdout
        --title <title>                 display title
        --backtitle <backtitle>         display backtitle
        --scrolltext                    force vertical scrollbars
        --topleft                       put window in top-left corner
        -h, --help                      print this message
        -v, --version                   print version information'
blockdev: cannot open /dev/Box options:
        --msgbox <text> <height> <width>
        --yesno  <text> <height> <width>
        --infobox <text> <height> <width>
        --inputbox <text> <height> <width> [init]
        --passwordbox <text> <height> <width> [init]
        --textbox <file> <height> <width>
        --menu <text> <height> <width> <listheight> [tag item] ...
        --checklist <text> <height> <width> <listheight> [tag item status]...
        --radiolist <text> <height> <width> <listheight> [tag item status]...
        --gauge <text> <height> <width> <percent>
Options: (depend on box-option)
        --clear                         clear screen on exit
        --defaultno                     default no button
        --default-item <string>         set default string
        --fb, --fullbuttons             use full buttons
        --nocancel                      no cancel button
        --yes-button <text>             set text of yes button
        --no-button <text>              set text of no button
        --ok-button <text>              set text of ok button
        --cancel-button <text>          set text of cancel button
        --noitem                        don't display items
        --notags                        don't display tags
        --separate-output               output one line at a time
        --output-fd <fd>                output to fd, not stdout
        --title <title>                 display title
        --backtitle <backtitle>         display backtitle
        --scrolltext                    force vertical scrollbars
        --topleft                       put window in top-left corner
        -h, --help                      print this message
        -v, --version                   print version information: File name too long
+ [[ ! -n '' ]]
+ echo 'FAILED (bad destination)'
FAILED (bad destination)
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "50 | Backup/Restore"\n\nPlease try                                                                                                   again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhab                                                                                                  ian/blob/master/docs/openhabian-DEBUG.md how to proceed.' 14 80
+ return 0
+ true
+ show_main_menu

did you attach the external reader and plug in the card? What does lsblk say ?

yes, external reader + sd card are attached.
lsblk doesn’t show the card …

[20:57:43] openhabian@ohab2:~$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0 14.9G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0 14.6G  0 part /
zram0       254:0    0  600M  0 disk [SWAP]
zram1       254:1    0  500M  0 disk /opt/zram/zram1
zram2       254:2    0  500M  0 disk /opt/zram/zram2
zram3       254:3    0  500M  0 disk /opt/zram/zram3

but here it is, isn’t it?

[20:58:00] openhabian@ohab2:~$ ls /dev/sd?
/dev/sda

no that’s just the device file to use when the device is there. But your device is not recognized.

ok, tried with a 10y old card reader that i found and the sd card was recognised immediately…
not i get a new error, from what i can see it’s something with /dev/sda3:

+ select_blkdev '^sd' 'Setup SD mirroring' 'Select USB device to copy the internal SD card data to'
+ [[ -z 1 ]]
+ array=()
+ declare -a array
+ read -r id foo foo size foo foo foo
++ lsblk -i
++ tr -d '`\\|'
++ grep -E '^sd'
++ tr -d '\\-'
+ array+=("$id" "$size")
+ read -r id foo foo size foo foo foo
+ [[ 2 -eq 0 ]]
++ whiptail --title 'Setup SD mirroring' --cancel-button Cancel --ok-button Select --menu 'Select USB device to copy the internal SD card data to' 12 76 4 sda 29.7G
+ retval=sda
+ [[ -z sda ]]
+ dest=/dev/sda
++ blockdev --getsize64 /dev/sda
+ [[ ! -n 31914983424 ]]
++ mount
++ grep /dev/sda
+ [[ -n '' ]]
+ infoText='DANGEROUS OPERATION, USE WITH PRECAUTION!\n\nThis will *copy* your system root from your SD card to a USB attached card writer device. Are you sure /dev/sda is an SD card writer device equipped with a dispensible SD card ? Are you this will destroy all data on that card and you want to proceed writing to this device ?'
++ blockdev --getsize64 /dev/mmcblk0
+ srcSize=15931539456
+ minSize=30269924966
++ blockdev --getsize64 /dev/sda
+ destSize=31914983424
+ [[ 31914983424 -lt 30269924966 ]]
+ sfdisk -d /dev/mmcblk0
+ sfdisk /dev/sda
Checking that no-one is using this disk right now ... OK

Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Card  Reader
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: 0xed06c8bf

Old situation:

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        2048 62332927 62330880 29.7G 83 Linux

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x63d526e8.
/dev/sda1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 256 MiB.
/dev/sda2: Created a new partition 2 of type 'Linux' and of size 14.6 GiB.
/dev/sda3: Done.

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

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2       532480 31116287 30583808 14.6G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
++ fdisk -l /dev/mmcblk0
++ head -1
++ cut '-d ' -f7
+ start=31116288
+ fdisk /dev/sda
+ partprobe
+ cond_redirect mke2fs -F -t ext4 /dev/sda3
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ mke2fs -F -t ext4 /dev/sda3 \033[39;49;00m'

$ mke2fs -F -t ext4 /dev/sda3
+ mke2fs -F -t ext4 /dev/sda3
mke2fs 1.44.5 (15-Dec-2018)
The file /dev/sda3 does not exist and no size was specified.
+ return 1
+ mkdir -p /storage
+ sed -e 's|%DEVICE|3|g' -e 's|%BKPDIR|/storage|g' /opt/openhabian/includes/storage.mount
+ cond_redirect systemctl enable --now storage.mount
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ systemctl enable --now storage.mount \033[39;49;00m'

$ systemctl enable --now storage.mount
+ systemctl enable --now storage.mount
Created symlink /etc/systemd/system/local-fs.target.wants/storage.mount → /etc/systemd/system/storage.mount.
Created symlink /etc/systemd/system/zram-config.service.wants/storage.mount → /etc/systemd/system/storage.mount.
Job for storage.mount failed.
See "systemctl status storage.mount" and "journalctl -xe" for details.
+ return 1
+ echo 'FAILED (enable storage mount)'
FAILED (enable storage mount)
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "50 | Backup/Restore"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/master/docs/openhabian-DEBUG.md how to proceed.' 14 80
+ return 0
+ true
+ show_main_menu
[13:09:47] openhabian@ohab2:~$ sudo systemctl status storage.mount
● storage.mount - /storage mount
   Loaded: loaded (/etc/systemd/system/storage.mount; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-09-16 13:05:56 CEST; 3min 58s ago
    Where: /storage
     What: 3

Sep 16 13:05:56 ohab2 systemd[1]: Mounting /storage mount...
Sep 16 13:05:56 ohab2 mount[28906]: mount: /storage: special device 3 does not exist.
Sep 16 13:05:56 ohab2 systemd[1]: storage.mount: Mount process exited, code=exited, status=32/n/a
Sep 16 13:05:56 ohab2 systemd[1]: storage.mount: Failed with result 'exit-code'.
Sep 16 13:05:56 ohab2 systemd[1]: Failed to mount /storage mount.
[13:09:54] openhabian@ohab2:~$ sudo journalctl -xe
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An n/a= process belonging to unit storage.mount has exited.
--
-- The process' exit code is 'exited' and its exit status is 32.
Sep 16 13:05:56 ohab2 systemd[1]: storage.mount: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit storage.mount has entered the 'failed' state with result 'exit-code'.
Sep 16 13:05:56 ohab2 systemd[1]: Failed to mount /storage mount.
-- Subject: A start job for unit storage.mount has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit storage.mount has finished with a failure.
--
-- The job identifier is 1973 and the job result is failed.
Sep 16 13:06:00 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [16/Sep/2020:13:06:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.
Sep 16 13:06:01 ohab2 influxd[689]: ts=2020-09-16T11:06:01.669851Z lvl=info msg="Executing query" log_id=0PGc5i90000 service=query query="SELECT mean(value) FROM openhab_db.autogen.DW_TempIst WHERE time >= now() - 1d G
Sep 16 13:06:01 ohab2 influxd[689]: ts=2020-09-16T11:06:01.679656Z lvl=info msg="Executing query" log_id=0PGc5i90000 service=query query="SELECT mean(value) FROM openhab_db.autogen.DW_TempSoll WHERE time >= now() - 1d
Sep 16 13:06:01 ohab2 influxd[689]: ts=2020-09-16T11:06:01.713968Z lvl=info msg="Executing query" log_id=0PGc5i90000 service=query query="SELECT mean(value) FROM openhab_db.autogen.DW_HeizungStatus WHERE time >= now()
Sep 16 13:06:01 ohab2 influxd[689]: [httpd] 192.168.178.53, 192.168.178.53,127.0.0.1 - grafana [16/Sep/2020:13:06:01 +0200] "GET /query?db=openhab_db&epoch=ms&q=SELECT+mean%28%22value%22%29+FROM+%22DW_TempIst%22+WHERE+
Sep 16 13:06:06 ohab2 sudo[28041]: pam_unix(sudo:session): session closed for user root
Sep 16 13:07:00 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [16/Sep/2020:13:07:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.
Sep 16 13:08:00 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [16/Sep/2020:13:08:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.
Sep 16 13:09:00 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [16/Sep/2020:13:09:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.
Sep 16 13:09:21 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [16/Sep/2020:13:09:21 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.
Sep 16 13:09:47 ohab2 sudo[29025]: openhabian : TTY=pts/1 ; PWD=/home/openhabian ; USER=root ; COMMAND=/bin/systemctl status storage.mount and journalctl -xe
Sep 16 13:09:47 ohab2 sudo[29025]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 16 13:09:47 ohab2 sudo[29025]: pam_unix(sudo:session): session closed for user root
Sep 16 13:09:54 ohab2 sudo[29034]: openhabian : TTY=pts/1 ; PWD=/home/openhabian ; USER=root ; COMMAND=/bin/systemctl status storage.mount
Sep 16 13:09:54 ohab2 sudo[29034]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 16 13:09:54 ohab2 sudo[29034]: pam_unix(sudo:session): session closed for user root
Sep 16 13:10:00 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [16/Sep/2020:13:10:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.
Sep 16 13:10:18 ohab2 sudo[29052]: openhabian : TTY=pts/1 ; PWD=/home/openhabian ; USER=root ; COMMAND=/bin/journalctl -xe
Sep 16 13:10:18 ohab2 sudo[29052]: pam_unix(sudo:session): session opened for user root by (uid=0)

For some reason that fdisk command didn’t create the third partition to become /storage.
Please change /opt/openhabian/functions/backup.bash:
remove the “&> /dev/null” from the fdisk line 473, then try again.
You’ll see a scripted editing of the partition table. If that does not work to create partition #3, try doing that interactively (fdisk /dev/sda, then enter those characters and ).

i think it was line 472, now looking like this:
fdisk "$dest" <<EOF

still didn’t work:

Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Card  Reader
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: 0x63d526e8

Old situation:

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2       532480 31116287 30583808 14.6G 83 Linux

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x0dc1ab62.
/dev/sda1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 256 MiB.
/dev/sda2: Created a new partition 2 of type 'Linux' and of size 14.6 GiB.
/dev/sda3: Done.

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

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2       532480 31116287 30583808 14.6G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
++ fdisk -l /dev/mmcblk0
++ head -1
++ cut '-d ' -f7
+ start=31116288
+ fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): Partition type
   p   primary (2 primary, 0 extended, 2 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (3,4, default 3): First sector (2048-62333951, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (31116288-62333951, default 62333951): Last sector, +/-sectors or +/-size{K,M,G,T,P} (31116288-62333951, default 62333951): Value out of range.
Last sector, +/-sectors or +/-size{K,M,G,T,P} (31116288-62333951, default 62333951): Value out of range.
Last sector, +/-sectors or +/-size{K,M,G,T,P} (31116288-62333951, default 62333951): Last sector, +/-sectors or +/-size{K,M,G,T,P} (31116288-62333951, default 62333951):
Command (m for help):
+ partprobe
+ cond_redirect mke2fs -F -t ext4 /dev/sda3
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ mke2fs -F -t ext4 /dev/sda3 \033[39;49;00m'

$ mke2fs -F -t ext4 /dev/sda3
+ mke2fs -F -t ext4 /dev/sda3
mke2fs 1.44.5 (15-Dec-2018)
The file /dev/sda3 does not exist and no size was specified.

“those characters”? :zipper_mouth_face:

Yes those chars right in the next lines (473ff). Those you would enter manually. Note the $start line, enter the value from above there.

okay

?
anyway… i’m stuck with the command “t” after $start

[16:34:29] root@ohab2:/home/openhabian# fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (2 primary, 0 extended, 2 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (3,4, default 3): 3
First sector (2048-62333951, default 2048): 31116288
Last sector, +/-sectors or +/-size{K,M,G,T,P} (31116288-62333951, default 62333951): t
Last sector, +/-sectors or +/-size{K,M,G,T,P} (31116288-62333951, default 62333951):

should it be capital “T”?
no idea why first sector default is 2048, when

[16:38:59] root@ohab2:/home/openhabian# fdisk -l /dev/sda
Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Card  Reader
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: 0x0dc1ab62

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2       532480 31116287 30583808 14.6G 83 Linux

No it shouldn’t ask about length/end, it does not do that on my box. No idea why it does on yours.

Try the following code instead.
Edit or download latest from https://github.com/openhab/openhabian/blob/master/functions/backup.bash

  # copy partition table
  start="$(fdisk -l /dev/mmcblk0 | head -1 | cut -d' ' -f7)"

  ((destSize-=start))
  (sfdisk -d /dev/mmcblk0;  echo "/dev/mmcblk0p3 : start=${start},size=${destSize}, type=83") | sfdisk "$dest"

  partprobe
  cond_redirect mke2fs -F -t ext4 "${dest}3"

i used the file from your link (as you suggested yesterday), now sda3 is created, but there’s still errors:

Old situation:

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2       532480 31116287 30583808 14.6G 83 Linux

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x93d25d6d.
/dev/sda1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 256 MiB.
/dev/sda2: Created a new partition 2 of type 'Linux' and of size 14.6 GiB.
/dev/sda3: Created a new partition 3 of type 'Linux' and of size 14.9 GiB.
/dev/sda4: Done.

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

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2         532480 31116287 30583808 14.6G 83 Linux
/dev/sda3       31116288 62333951 31217664 14.9G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
+ partprobe
+ cond_redirect mke2fs -F -t ext4 /dev/sda3
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ mke2fs -F -t ext4 /dev/sda3 \033[39;49;00m'

$ mke2fs -F -t ext4 /dev/sda3
+ mke2fs -F -t ext4 /dev/sda3
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 3902208 4k blocks and 977280 inodes
Filesystem UUID: 7d357d22-2250-4d96-b5ce-042d6468ec40
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

+ return 0
+ mkdir -p /storage
+ sed -e 's|%DEVICE|3|g' -e 's|%BKPDIR|/storage|g' /opt/openhabian/includes/storage.mount
+ cond_redirect systemctl enable --now storage.mount
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ systemctl enable --now storage.mount \033[39;49;00m'

$ systemctl enable --now storage.mount
+ systemctl enable --now storage.mount
Job for storage.mount failed.
See "systemctl status storage.mount" and "journalctl -xe" for details.
[10:44:59] root@ohab2:/opt/openhabian/functions# journalctl -xe
-- this directory become inaccessible. To see those over-mounted files,
-- please manually mount the underlying file system to a secondary
-- location.
Sep 17 10:44:53 ohab2 systemd[1]: Mounting /storage mount...
-- Subject: A start job for unit storage.mount has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit storage.mount has begun execution.
--
-- The job identifier is 3108.
Sep 17 10:44:53 ohab2 mount[22143]: mount: /storage: special device 3 does not exist.
Sep 17 10:44:53 ohab2 systemd[1]: storage.mount: Mount process exited, code=exited, status=32/n/a
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An n/a= process belonging to unit storage.mount has exited.
--
-- The process' exit code is 'exited' and its exit status is 32.
Sep 17 10:44:53 ohab2 systemd[1]: storage.mount: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit storage.mount has entered the 'failed' state with result 'exit-code'.
Sep 17 10:44:53 ohab2 systemd[1]: Failed to mount /storage mount.
-- Subject: A start job for unit storage.mount has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit storage.mount has finished with a failure.
--
-- The job identifier is 3108 and the job result is failed.
Sep 17 10:45:00 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [17/Sep/2020:10:45:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 123fa2d5-f8c2-11ea-8a7c
Sep 17 10:45:01 ohab2 CRON[22213]: pam_unix(cron:session): session opened for user root by (uid=0)
Sep 17 10:45:01 ohab2 CRON[22217]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Sep 17 10:45:01 ohab2 CRON[22213]: pam_unix(cron:session): session closed for user root
Sep 17 10:46:00 ohab2 influxd[689]: [httpd] 127.0.0.1 - openhab [17/Sep/2020:10:46:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 3602ebc1-f8c2-11ea-8a7d
[10:46:50] root@ohab2:/opt/openhabian/functions# systemctl status storage.mount
● storage.mount - /storage mount
   Loaded: loaded (/etc/systemd/system/storage.mount; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-09-17 10:44:53 CEST; 2min 6s ago
    Where: /storage
     What: 3

Sep 17 10:44:53 ohab2 systemd[1]: Mounting /storage mount...
Sep 17 10:44:53 ohab2 mount[22143]: mount: /storage: special device 3 does not exist.
Sep 17 10:44:53 ohab2 systemd[1]: storage.mount: Mount process exited, code=exited, status=32/n/a
Sep 17 10:44:53 ohab2 systemd[1]: storage.mount: Failed with result 'exit-code'.
Sep 17 10:44:53 ohab2 systemd[1]: Failed to mount /storage mount.

In L475 of /opt/openhabian/functions/backup.bash (the one with “sed …”) replace backupdrive with dest and try again. Show earlier debug output next time as well please.

Ok, now the script was executed without error:

++ whiptail --title 'Backup options' --menu 'Backup options' 14 116 7 --cancel-button Back --ok-button Execute '50 | Backup openHAB config' 'Backup the current active openHAB configuration' '51 | Restore an openHAB config' 'Restore a previous openHAB configuration from backup' '52 | Amanda System Backup' 'Set up Amanda to comprehensively backup your complete openHABian box' '53 | Setup SD mirroring' 'Setup mirroring of internal to external SD card' '   | Remove SD mirroring' 'Disable mirroring of SD cards' '54 | Raw copy SD' 'Raw copy internal SD to external disk / SD card' '55 | Sync SD' 'Rsync internal SD to external disk / SD card'
+ choice2='53 | Setup SD mirroring'
+ '[' 0 -eq 1 ']'
+ '[' 1 -eq 255 ']'
+ case "$choice2" in
+ setup_mirror_SD install
+ local dest
+ local srcSize
+ local destSize
+ local minSize
+ local targetDir=/etc/systemd/system/
+ local storageDir=/storage
+ local 'sizeError=your destination SD card device does not have enough space, it needs to have at least twice as much as the source'
+ local 'infoText1=DANGEROUS OPERATION, USE WITH PRECAUTION!\n\nThis will *copy* your system root from your SD card to a USB attached card writer device. Are you sure'
+ local 'infoText2=is an SD card writer device equipped with a dispensible SD card ? Are you this will destroy all data on that card and you want to proceed writing to this device ?'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2020-09-17_15:05:02_CEST [openHABian] Setting up automated SD mirroring and backup... '
2020-09-17_15:05:02_CEST [openHABian] Setting up automated SD mirroring and backup... + [[ install == \r\e\m\o\v\e ]]
+ [[ install != \i\n\s\t\a\l\l ]]
+ 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
+ [[ -n '' ]]
+ [[ -n 1 ]]
+ select_blkdev '^sd' 'Setup SD mirroring' 'Select USB device to copy the internal SD card data to'
+ [[ -z 1 ]]
+ array=()
+ declare -a array
+ read -r id foo foo size foo foo foo
++ lsblk -i
++ tr -d '`\\|'
++ grep -E '^sd'
++ tr -d '\\-'
+ array+=("$id" "$size")
+ read -r id foo foo size foo foo foo
+ array+=("$id" "$size")
+ read -r id foo foo size foo foo foo
+ [[ 4 -eq 0 ]]
++ whiptail --title 'Setup SD mirroring' --cancel-button Cancel --ok-button Select --menu 'Select USB device to copy the internal SD card data to' 12 76 4 sda 29.7G sdb 1.9G
+ retval=sda
+ [[ -z sda ]]
+ dest=/dev/sda
++ blockdev --getsize64 /dev/sda
+ [[ ! -n 31914983424 ]]
++ mount
++ grep /dev/sda
+ [[ -n '' ]]
+ infoText='DANGEROUS OPERATION, USE WITH PRECAUTION!\n\nThis will *copy* your system root from your SD card to a USB attached card writer device. Are you sure /dev/sda is an SD card writer device equipped with a dispensible SD card ? Are you this will destroy all data on that card and you want to proceed writing to this device ?'
++ blockdev --getsize64 /dev/mmcblk0
+ srcSize=15931539456
+ minSize=30269924966
++ blockdev --getsize64 /dev/sda
+ destSize=31914983424
+ [[ 31914983424 -lt 30269924966 ]]
++ fdisk -l /dev/mmcblk0
++ head -1
++ cut '-d ' -f7
+ start=31116288
+ (( destSize-=start ))
+ sfdisk -d /dev/mmcblk0
+ sfdisk /dev/sda
+ echo '/dev/mmcblk0p3 : start=31116288,size=31883867136, type=83'
Checking that no-one is using this disk right now ... OK

Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Card  Reader
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: 0x93d25d6d

Old situation:

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2         532480 31116287 30583808 14.6G 83 Linux
/dev/sda3       31116288 62333951 31217664 14.9G 83 Linux

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

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

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sda2         532480 31116287 30583808 14.6G 83 Linux
/dev/sda3       31116288 62333951 31217664 14.9G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
+ partprobe
+ cond_redirect mke2fs -F -t ext4 /dev/sda3
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ mke2fs -F -t ext4 /dev/sda3 \033[39;49;00m'

$ mke2fs -F -t ext4 /dev/sda3
+ mke2fs -F -t ext4 /dev/sda3
mke2fs 1.44.5 (15-Dec-2018)
/dev/sda3 contains a ext4 file system
        created on Thu Sep 17 10:44:47 2020
Creating filesystem with 3902208 4k blocks and 977280 inodes
Filesystem UUID: 30940710-15c1-4afc-80cb-8cfb4c2342de
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

+ return 0
+ mkdir -p /storage
+ sed -e 's|%DEVICE|/dev/sda3|g' -e 's|%BKPDIR|/storage|g' /opt/openhabian/includes/storage.mount
+ cond_redirect systemctl enable --now storage.mount
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ systemctl enable --now storage.mount \033[39;49;00m'

$ systemctl enable --now storage.mount
+ systemctl enable --now storage.mount
+ return 0
+ [[ -n 1 ]]
+ whiptail --title 'Copy system root to /dev/sda' --yes-button Continue --no-button Back --yesno 'DANGEROUS OPERATION, USE WITH PRECAUTION!\n\nThis will *copy* your system root from your SD card to a USB attached card writer device. Are you sure /dev/sda is an SD card writer device equipped with a dispensible SD card ? Are you this will destroy all data on that card and you want to proceed writing to this device ?' 22 116
+ sed -e 's|%DEST|/dev/sda|g' /opt/openhabian/includes/sdrawcopy.service_template
+ cond_redirect cp /opt/openhabian/includes/sdrsync.service /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system//
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ cp /opt/openhabian/includes/sdrsync.service /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system// \033[39;49;00m'

$ cp /opt/openhabian/includes/sdrsync.service /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system//
+ cp /opt/openhabian/includes/sdrsync.service /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system//
+ return 0
+ echo OK
OK
+ cond_redirect install -m 755 /opt/openhabian/includes/mirror_SD /usr/local/sbin
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ install -m 755 /opt/openhabian/includes/mirror_SD /usr/local/sbin \033[39;49;00m'

$ install -m 755 /opt/openhabian/includes/mirror_SD /usr/local/sbin
+ install -m 755 /opt/openhabian/includes/mirror_SD /usr/local/sbin
+ return 0
+ cond_redirect systemctl -q daemon-reload
+ cond_redirect systemctl enable --now sdrawcopy.timer sdrsync.timer
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ systemctl enable --now sdrawcopy.timer sdrsync.timer \033[39;49;00m'

$ systemctl enable --now sdrawcopy.timer sdrsync.timer
+ systemctl enable --now sdrawcopy.timer sdrsync.timer
Created symlink /etc/systemd/system/timers.target.wants/sdrawcopy.timer → /etc/systemd/system/sdrawcopy.timer.
Created symlink /etc/systemd/system/timers.target.wants/sdrsync.timer → /etc/systemd/system/sdrsync.timer.
+ return 0
+ echo OK
OK
+ [[ -z 1 ]]
+ '[' 0 -ne 0 ']'
+ true
+ show_main_menu
+++ get_git_revision
+++ local branch
+++ local latestTag
+++ local revCount
+++ local shorthash
++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
+++ branch=master
++++ git -C /opt/openhabian describe --tags --abbrev=0
+++ latestTag=v1.6-alpha
++++ git -C /opt/openhabian log --oneline
++++ wc -l
+++ revCount=814
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=1b99f08
+++ echo '[master]v1.6-alpha-814(1b99f08)'
++ whiptail --title 'Welcome to the openHABian Configuration Tool [master]v1.6-alpha-814(1b99f08)' --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 ►'

but there was nothing about amanda… from the docs i understood that this option would also install amanda and backup to /dev/sdX3…

The install routine will also setup Amanda to take daily backups and store them to that third partition.

tbh i also assumed that the mirroring would take place on an specific time table, but as far as i understood this happens only once?

Yes but only if you run it unattended.
You can of course setup Amanda additionally.
Is that unclear from the docs ?

It should. Check systemctl list-timers

is this it?

NEXT                          LEFT                LAST                          PASSED       UNIT                         ACTIVATES
Sat 2020-09-19 02:00:00 CEST  17h left            Fri 2020-09-18 02:00:16 CEST  6h ago       sdrsync.timer                sdrsync.service

imho it’s not very clear. maybe add another paragraph for “later” installation via openhabian-config where you mention the openhabian-config option (53) and that amanda in this case must be set up separately.

Yes and there should be another one ...sdrawcopy...

yes, missed that previously:
Thu 2020-10-01 02:00:00 CEST 1 weeks 5 days left n/a n/a sdrawcopy.timer sdrawcopy.service
this tuns every 1st of month?

yes. I’d think you can enforce it for a test: systemctl start sdrawcopy.service

also updated the docs a little

i tried, i failed:

[13:18:44] root@ohab2:/home/openhabian# systemctl start sdrawcopy.service
Job for sdrawcopy.service failed because the control process exited with error code.
See "systemctl status sdrawcopy.service" and "journalctl -xe" for details.
[13:18:46] root@ohab2:/home/openhabian# systemctl status sdrawcopy.service
● sdrawcopy.service - SD card raw device copy to external card reader device
   Loaded: loaded (/etc/systemd/system/sdrawcopy.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-09-18 13:18:46 CEST; 4s ago
  Process: 25784 ExecStart=/usr/local/sbin/mirror_SD raw /dev/sda (code=exited, status=1/FAILURE)
 Main PID: 25784 (code=exited, status=1/FAILURE)

Sep 18 13:18:46 ohab2 systemd[1]: Starting SD card raw device copy to external card reader device...
Sep 18 13:18:46 ohab2 mirror_SD[25784]: blockdev: cannot open : No such file or directory
Sep 18 13:18:46 ohab2 mirror_SD[25784]: FAILED (bad destination)
Sep 18 13:18:46 ohab2 systemd[1]: sdrawcopy.service: Main process exited, code=exited, status=1/FAILURE
Sep 18 13:18:46 ohab2 systemd[1]: sdrawcopy.service: Failed with result 'exit-code'.
Sep 18 13:18:46 ohab2 systemd[1]: Failed to start SD card raw device copy to external card reader device.
[13:18:51] root@ohab2:/home/openhabian# journalctl -xe
-- A start job for unit sdrawcopy.service has finished with a failure.
--
-- The job identifier is 1894 and the job result is failed.
Sep 18 13:18:30 ohab2 sudo[25755]: pam_unix(sudo:session): session closed for user root
Sep 18 13:18:44 ohab2 sudo[25770]: openhabian : TTY=pts/0 ; PWD=/home/openhabian ; USER=root ; COMMAND=/bin/bash
Sep 18 13:18:44 ohab2 sudo[25770]: pam_unix(sudo:session): session opened for user root by openhabian(uid=0)
Sep 18 13:18:46 ohab2 systemd[1]: Starting SD card raw device copy to external card reader device...
-- Subject: A start job for unit sdrawcopy.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit sdrawcopy.service has begun execution.
--
-- The job identifier is 1964.
Sep 18 13:18:46 ohab2 mirror_SD[25784]: blockdev: cannot open : No such file or directory
Sep 18 13:18:46 ohab2 mirror_SD[25784]: FAILED (bad destination)
Sep 18 13:18:46 ohab2 systemd[1]: sdrawcopy.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit sdrawcopy.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Sep 18 13:18:46 ohab2 systemd[1]: sdrawcopy.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit sdrawcopy.service has entered the 'failed' state with result 'exit-code'.
Sep 18 13:18:46 ohab2 systemd[1]: Failed to start SD card raw device copy to external card reader device.
-- Subject: A start job for unit sdrawcopy.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit sdrawcopy.service has finished with a failure.
--
-- The job identifier is 1964 and the job result is failed.
Sep 18 13:19:00 ohab2 influxd[660]: [httpd] 127.0.0.1 - openhab [18/Sep/2020:13:19:00 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1"
[13:19:05] root@ohab2:/home/openhabian#

great, looks good now!

You can (as root) also manually run /usr/local/sbin/mirror_SD "raw" /dev/sda,
eventually add a “-x” to first line of /usr/local/sbin/mirror_SD to see debug output