then manually recreate, format and mkfs that partition then setup Amanda again from menu.
(well, or reinstall).
then manually recreate, format and mkfs that partition then setup Amanda again from menu.
(well, or reinstall).
reinstall means running option 53 again (do i need to “Remove SD mirroring” before?)?
/etc/systemd/system/sdrawcopy.service
still has the “old” device in the command: ExecStart=/usr/local/sbin/mirror_SD "raw" /dev/sda
this would also be corrected with reinstallation?
no reinstall means reinstall from the very beginning (image)
yes
If you don’t reinstall you can simply edit that and systemctl daemon-reload
But I suspect option 54 / mirror_SD start overwrote your 3rd partition.
Please before reinstalling try to manually create that partition again, put some file there and unmount it. Then use option 54 again and after that check if partition 3 is still there: use fdisk to show and if it’s there mount it again.
ok, now i have trouble mounting that partition… shouldn’t /storage
be empty?
[13:58:35] root@ohab2:/storage/zram# ls
zramsync.log zram.tar
the files in this folder are only there:
[13:58:35] root@ohab2:/storage/zram# find / -name zram.tar
/storage/zram/zram.tar
[14:01:25] root@ohab2:/storage/zram# find / -name zramsync.log
/storage/zram/zramsync.log
[14:01:48] root@ohab2:/storage/zram#
on reboot sdb3 was mounted to /storage, but the zram folder is still there.
and i lost the persistence data again…
on reboot sd card (for autobackup) and usb stick (for influxdb) changed device name/number
[14:12:52] root@ohab2:/storage/zram# blkid
/dev/sdb1: UUID="fbbff3f2-ab8d-d601-f017-f3f2ab8dd601" TYPE="ext4" PARTUUID="eeaebe6d-01"
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="f19154a6-01"
/dev/sda2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="f19154a6-02"
/dev/sda3: UUID="a278f5b0-9301-4178-b89b-58ccc1ba150a" TYPE="ext4" PARTUUID="f19154a6-03"
SD Card with 3 partitions was /dev/sdb
before reboot…
now /etc/systemd/system/sdrawcopy.service
is wrong again
Do not not mix and confuse stuff. Let ZRAM out of the game. The problem is about selecting right boot partitions that also affects ZRAM, .service and anything you change.
Let’s get back to a defined starting point.
First, check PARTUUIDs are different.
Download https://raw.githubusercontent.com/mstormi/openhabian/safetyCheckSDsync/functions/backup.bash to /opt/openhabian/functions
, start openhabian-config (but do NOT let it update !), then
execute option 53 (setup mirroring). That should create copies of partitions 1 & 2 and create partition 3 (which should get mounted on boot as /storage)…
After that, double-check PARTUUIDs are different.
Finally, reboot to be safe.
yes, they are different:
[14:12:52] root@ohab2:/storage/zram# blkid
## sdcard internal:
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="d0c18a5b-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="d0c18a5b-02"
## usb stick:
/dev/sdb1: UUID="fbbff3f2-ab8d-d601-f017-f3f2ab8dd601" TYPE="ext4" PARTUUID="eeaebe6d-01"
## sdcard external:
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="f19154a6-01"
/dev/sda2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="f19154a6-02"
/dev/sda3: UUID="a278f5b0-9301-4178-b89b-58ccc1ba150a" TYPE="ext4" PARTUUID="f19154a6-03"
## ...
/dev/zram0: LABEL="zram-config0" UUID="ff85f7f7-daa0-4742-b222-054894accba5" TYPE="swap"
/dev/zram1: UUID="7c84a8e7-65f9-4a87-933e-0fe931fc2f9d" TYPE="ext4"
/dev/mmcblk0: PTUUID="d0c18a5b" PTTYPE="dos"
/dev/zram2: UUID="f9557e16-9859-478f-885c-857edb5c50c8" TYPE="ext4"
didn’t ask to. it updated itself earlier today…
[master]v1.6-alpha-845(116468c)
should i proceed nonetheless?
should i remove the fstab entry for /storage?
if the modified backup.bash is there yes
there is one ? yes unmount and remove it
mount is a service see systemctl status storage.mount
, it should be active after boot
ok, executed option 53, here’s the last lines:
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: 0xf19154a6
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 0xdb11638f.
/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 14.6 GiB.
Partition #2 contains a ext4 signature.
/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: 0xdb11638f
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
last mounted on /storage on Wed Sep 23 14:03:25 2020
Creating filesystem with 3902208 4k blocks and 977280 inodes
Filesystem UUID: 96264c72-eb4e-4700-ba97-2acfbda2eeaf
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
+ mirror_SD raw /dev/sda
+ local src=/dev/mmcblk0
+ local dest
+ local start
+ local storageDir=/storage
+ local syncMount=/storage/syncmount
+ local dirty=no
+ local 'dumpInfoText=For your information as the operator of this openHABian system:\nA timed background job to run semiannually has just created a full raw device copy of your RPI'\''s internal SD card.\nOnly partitions to contain openHABian (/boot and / partitions 1 & 2) were copied.'
+ [[ -n 1 ]]
+ select_blkdev '^sd' 'Setup SD mirroring' 'Select the USB attached disk 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 the USB attached disk device to copy the internal SD card data to' 12 76 4 sda 29.7G sdb 1006M
+ retval=sda
+ [[ -z sda ]]
+ dest=/dev/sda
+ [[ /dev/mmcblk0 == \/\d\e\v\/\s\d\a ]]
++ blockdev --getsize64 /dev/sda
+ [[ -n 31914983424 ]]
++ mount
++ grep /dev/sda
+ [[ -n '' ]]
+ [[ raw == \r\a\w ]]
+ for i in 1 2
++ blockdev --getsize64 /dev/mmcblk0p1
+ srcSize=268435456
++ blockdev --getsize64 /dev/sda1
+ destSize=268435456
+ [[ 268435456 -lt 268435456 ]]
+ for i in 1 2
++ blockdev --getsize64 /dev/mmcblk0p2
+ srcSize=15658909696
++ blockdev --getsize64 /dev/sda2
+ destSize=15658909696
+ [[ 15658909696 -lt 15658909696 ]]
+ echo 'Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card'
Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card
+ cond_redirect dd if=/dev/mmcblk01 bs=1M of=/dev/sda1
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ dd if=/dev/mmcblk01 bs=1M of=/dev/sda1 \033[39;49;00m'
$ dd if=/dev/mmcblk01 bs=1M of=/dev/sda1
+ dd if=/dev/mmcblk01 bs=1M of=/dev/sda1
dd: failed to open '/dev/mmcblk01': No such file or directory
+ return 1
+ echo 'FAILED (raw device copy of /dev/sda1)'
FAILED (raw device copy of /dev/sda1)
+ dirty=yes
+ cond_redirect dd if=/dev/mmcblk02 bs=1M of=/dev/sda2
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ dd if=/dev/mmcblk02 bs=1M of=/dev/sda2 \033[39;49;00m'
$ dd if=/dev/mmcblk02 bs=1M of=/dev/sda2
+ dd if=/dev/mmcblk02 bs=1M of=/dev/sda2
dd: failed to open '/dev/mmcblk02': No such file or directory
+ return 1
+ echo 'FAILED (raw device copy of /dev/sda2)'
FAILED (raw device copy of /dev/sda2)
+ dirty=yes
+ yes
+ cond_redirect set-partuuid /dev/sda2 random
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ set-partuuid /dev/sda2 random \033[39;49;00m'
$ set-partuuid /dev/sda2 random
+ set-partuuid /dev/sda2 random
Set PARTUUID on /dev/sda2 to random (y/n)? y
PARTUUID on /dev/sda2 is set to 32be4b5f-02
+ return 0
+ cond_redirect fsck -y -t ext4 /dev/sda2
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fsck -y -t ext4 /dev/sda2 \033[39;49;00m'
$ fsck -y -t ext4 /dev/sda2
+ fsck -y -t ext4 /dev/sda2
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
rootfs: clean, 73903/936000 files, 1454139/3822976 blocks
+ return 0
+ [[ yes == \n\o ]]
+ echo 'For your information as the operator of this openHABian system:\nA timed background job to run semiannually has just created a full raw device copy of your RPI'\''s internal SD card.\nOnly partitions to contain openHABian (/boot and / partitions 1 & 2) were copied.'
+ Mail -s 'SD card raw copy dump' ''
/opt/openhabian/functions/backup.bash: line 397: Mail: command not found
+ return 0
++ basename /storage
+ mountUnit=storage.mount
+ sed -e 's|%DEVICE|/dev/sda3|g' -e 's|%STORAGE|/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
+ sed -e 's|%DEST|/dev/sda|g' /opt/openhabian/includes/sdrsync.service_template
+ cond_redirect cp /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system//
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ cp /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system// \033[39;49;00m'
$ cp /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system//
+ cp /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
+ 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=845
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=116468c
+++ echo '[master]v1.6-alpha-845(116468c)'
++ whiptail --title 'Welcome to the openHABian Configuration Tool [master]v1.6-alpha-845(116468c)' --menu 'Setup Options' 18 116 11 --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 ►'
+ choice=
+ RET=1
+ '[' 1 -eq 1 ']'
+ return 255
+ system_check_default_password
+ 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
+ local algo
+ local defaultPassword
+ local defaultUser
+ local generatedPassword
+ local introText
+ local originalPassword
+ local salt
+ 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
+ id -u pi
+ 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
+ defaultUser=openhabian
+ defaultPassword=openhabian
++ grep -w openhabian /etc/shadow
++ cut -d: -f2
+ originalPassword='$6$Oa2jE7q9LCf2pwQg$CLetQr8dlemHVGxr9.wbHNvBb6ka.UdH.8usMFy8XpTqxGP15mVAkART3WMCVWhNCWoGU7kJFpwyuyp1EpmpQ1'
++ echo '$6$Oa2jE7q9LCf2pwQg$CLetQr8dlemHVGxr9.wbHNvBb6ka.UdH.8usMFy8XpTqxGP15mVAkART3WMCVWhNCWoGU7kJFpwyuyp1EpmpQ1'
++ cut '-d$' -f2
+ algo=6
+ introText='The default password was detected on your system! That is a serious security concern. Bad guys or malicious programs in your subnet are able to gain root access!\n\nPlease set a strong password by typing the command '\''passwd openhabian'\''!'
++ echo '$6$Oa2jE7q9LCf2pwQg$CLetQr8dlemHVGxr9.wbHNvBb6ka.UdH.8usMFy8XpTqxGP15mVAkART3WMCVWhNCWoGU7kJFpwyuyp1EpmpQ1'
++ cut '-d$' -f3
+ salt=Oa2jE7q9LCf2pwQg
+ export algo defaultPassword salt
++ perl -le 'print crypt("$ENV{defaultPassword}","\$$ENV{algo}\$$ENV{salt}\$")'
+ generatedPassword='$6$Oa2jE7q9LCf2pwQg$9HTAmBlN7dLelML.38m4zn0c87LbiBI6xQjDcD5xAeCDQQuMxeD6a3ueqs8x2w13Kogedhqd.gVsgbQ96lNM71'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2020-09-23_14:47:47_CEST [openHABian] Checking for default openHABian username:password combination... '
2020-09-23_14:47:47_CEST [openHABian] Checking for default openHABian username:password combination... ++ id -u openhabian
+ [[ -n 1000 ]]
+ [[ $6$Oa2jE7q9LCf2pwQg$9HTAmBlN7dLelML.38m4zn0c87LbiBI6xQjDcD5xAeCDQQuMxeD6a3ueqs8x2w13Kogedhqd.gVsgbQ96lNM71 == \$\6\$\O\a\2\j\E\7\q\9\L\C\f\2\p\w\Q\g\$\C\L\e\t\Q\r\8\d\l\e\m\H\V\G\x\r\9\.\w\b\H\N\v\B\b\6\k\a\.\U\d\H\.\8\u\s\M\F\y\8\X\p\T\q\x\G\P\1\5\m\V\A\k\A\R\T\3\W\M\C\V\W\h\N\C\W\o\G\U\7\k\J\F\p\w\y\u\y\p\1\E\p\m\p\Q\1 ]]
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -e '2020-09-23_14:47:47_CEST [openHABian] We hope you got what you came for! See you again soon ;)'
2020-09-23_14:47:47_CEST [openHABian] We hope you got what you came for! See you again soon ;)
+ cd /opt/openhabian/functions
PARTUUID are different.
[14:47:47] root@ohab2:/opt/openhabian/functions# blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="d0c18a5b-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="d0c18a5b-02"
/dev/sdb1: UUID="fbbff3f2-ab8d-d601-f017-f3f2ab8dd601" TYPE="ext4" PARTUUID="eeaebe6d-01"
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="32be4b5f-01"
/dev/sda2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="32be4b5f-02"
/dev/sda3: UUID="96264c72-eb4e-4700-ba97-2acfbda2eeaf" TYPE="ext4" PARTUUID="32be4b5f-03"
/dev/zram0: LABEL="zram-config0" UUID="ff85f7f7-daa0-4742-b222-054894accba5" TYPE="swap"
/dev/zram1: UUID="7c84a8e7-65f9-4a87-933e-0fe931fc2f9d" TYPE="ext4"
/dev/zram2: UUID="f9557e16-9859-478f-885c-857edb5c50c8" TYPE="ext4"
/dev/mmcblk0: PTUUID="d0c18a5b" PTTYPE="dos"
sda3 is mounted:
[14:50:24] root@ohab2:/opt/openhabian/functions# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 29.7G 0 disk
├─sda1 8:1 1 256M 0 part
├─sda2 8:2 1 14.6G 0 part
└─sda3 8:3 1 14.9G 0 part /storage
sdb 8:16 1 1006M 0 disk
└─sdb1 8:17 1 1003M 0 part /media/influxdbstick
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
rebooting now…
PARTUIID still different, /storage
mounted correctly:
[15:00:30] root@ohab2:/home/openhabian# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 29.7G 0 disk
├─sda1 8:1 1 256M 0 part
├─sda2 8:2 1 14.6G 0 part
└─sda3 8:3 1 14.9G 0 part /storage
sdb 8:16 1 1006M 0 disk
└─sdb1 8:17 1 1003M 0 part /media/influxdbstick
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
[15:00:34] root@ohab2:/home/openhabian# blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="d0c18a5b-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="d0c18a5b-02"
/dev/sdb1: UUID="fbbff3f2-ab8d-d601-f017-f3f2ab8dd601" TYPE="ext4" PARTUUID="eeaebe6d-01"
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="32be4b5f-01"
/dev/sda2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="32be4b5f-02"
/dev/sda3: UUID="96264c72-eb4e-4700-ba97-2acfbda2eeaf" TYPE="ext4" PARTUUID="32be4b5f-03"
/dev/mmcblk0: PTUUID="d0c18a5b" PTTYPE="dos"
/dev/zram0: LABEL="zram-config0" UUID="95527eb2-fd5e-4b63-aa91-d1d839f095b8" TYPE="swap"
/dev/zram1: UUID="c323b28d-76de-49b3-be89-d98348c28fa4" TYPE="ext4"
/dev/zram2: UUID="ebe2850a-64f3-448d-8ee4-841014de1249" TYPE="ext4"
but what is this zram folder doing there?
[15:00:40] root@ohab2:/home/openhabian# ls /storage/
lost+found zram
There’s a “p” missing, L389+390 must read
if ! cond_redirect dd if="${src}p1" bs=1M of="${dest}1"; then echo "FAILED (raw device copy of ${dest}1)"; dirty="yes"; fi
if ! cond_redirect dd if="${src}p2" bs=1M of="${dest}2"; then echo "FAILED (raw device copy of ${dest}2)"; dirty="yes"; fi
systemctl stop storage.mount
, then change the code and re-run option 53.
As I said forget about ZRAM. It’s normal /storage
is where it stores its stuff.
okay, modified backup.bash. i have to select the right sd card TWICE (already happened on the previous run…):
+ 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 1006M
+ 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
Checking that no-one is using this disk right now ... FAILED
This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.
sfdisk: Use the --force flag to overrule all checks.
+ echo '/dev/mmcblk0p3 : start=31116288,size=31883867136, type=83'
+ 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
last mounted on /storage on Wed Sep 23 14:53:44 2020
/dev/sda3 is mounted; will not make a filesystem here!
+ return 1
+ mirror_SD raw /dev/sda
+ local src=/dev/mmcblk0
+ local dest
+ local start
+ local storageDir=/storage
+ local syncMount=/storage/syncmount
+ local dirty=no
+ local 'dumpInfoText=For your information as the operator of this openHABian system:\nA timed background job to run semiannually has just created a full raw device copy of your RPI'\''s internal SD card.\nOnly partitions to contain openHABian (/boot and / partitions 1 & 2) were copied.'
+ [[ -n 1 ]]
+ select_blkdev '^sd' 'Setup SD mirroring' 'Select the USB attached disk 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 the USB attached disk device to copy the internal SD card data to' 12 76 4 sda 29.7G sdb 1006M
+ retval=sda
+ [[ -z sda ]]
+ dest=/dev/sda
+ [[ /dev/mmcblk0 == \/\d\e\v\/\s\d\a ]]
++ blockdev --getsize64 /dev/sda
+ [[ -n 31914983424 ]]
++ mount
++ grep /dev/sda
+ [[ -n '' ]]
+ [[ raw == \r\a\w ]]
+ for i in 1 2
++ blockdev --getsize64 /dev/mmcblk0p1
+ srcSize=268435456
++ blockdev --getsize64 /dev/sda1
+ destSize=268435456
+ [[ 268435456 -lt 268435456 ]]
+ for i in 1 2
++ blockdev --getsize64 /dev/mmcblk0p2
+ srcSize=15658909696
++ blockdev --getsize64 /dev/sda2
+ destSize=15658909696
+ [[ 15658909696 -lt 15658909696 ]]
+ echo 'Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card'
Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card
+ cond_redirect dd if=/dev/mmcblk0p1 bs=1M of=/dev/sda1
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ dd if=/dev/mmcblk0p1 bs=1M of=/dev/sda1 \033[39;49;00m'
$ dd if=/dev/mmcblk0p1 bs=1M of=/dev/sda1
+ dd if=/dev/mmcblk0p1 bs=1M of=/dev/sda1
256+0 records in
256+0 records out
268435456 bytes (268 MB, 256 MiB) copied, 18.3134 s, 14.7 MB/s
+ return 0
+ cond_redirect dd if=/dev/mmcblk0p2 bs=1M of=/dev/sda2
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ dd if=/dev/mmcblk0p2 bs=1M of=/dev/sda2 \033[39;49;00m'
$ dd if=/dev/mmcblk0p2 bs=1M of=/dev/sda2
+ dd if=/dev/mmcblk0p2 bs=1M of=/dev/sda2
14933+1 records in
14933+1 records out
15658909696 bytes (16 GB, 15 GiB) copied, 984.193 s, 15.9 MB/s
+ return 0
+ yes
+ cond_redirect set-partuuid /dev/sda2 random
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ set-partuuid /dev/sda2 random \033[39;49;00m'
$ set-partuuid /dev/sda2 random
+ set-partuuid /dev/sda2 random
Set PARTUUID on /dev/sda2 to random (y/n)? y
PARTUUID on /dev/sda2 is set to 8a35ae9d-02
+ return 0
+ cond_redirect fsck -y -t ext4 /dev/sda2
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fsck -y -t ext4 /dev/sda2 \033[39;49;00m'
$ fsck -y -t ext4 /dev/sda2
+ fsck -y -t ext4 /dev/sda2
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
rootfs: clean, 73963/936000 files, 1469813/3822976 blocks
+ return 0
+ [[ no == \n\o ]]
+ echo OK
OK
+ echo 'For your information as the operator of this openHABian system:\nA timed background job to run semiannually has just created a full raw device copy of your RPI'\''s internal SD card.\nOnly partitions to contain openHABian (/boot and / partitions 1 & 2) were copied.'
+ Mail -s 'SD card raw copy dump' ''
/opt/openhabian/functions/backup.bash: line 397: Mail: command not found
+ return 0
++ basename /storage
+ mountUnit=storage.mount
+ sed -e 's|%DEVICE|/dev/sda3|g' -e 's|%STORAGE|/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
+ sed -e 's|%DEST|/dev/sda|g' /opt/openhabian/includes/sdrsync.service_template
+ cond_redirect cp /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system//
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ cp /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system// \033[39;49;00m'
$ cp /opt/openhabian/includes/sdrawcopy.timer /opt/openhabian/includes/sdrsync.timer /etc/systemd/system//
+ cp /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
+ 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=845
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=116468c
+++ echo '[master]v1.6-alpha-845(116468c)'
++ whiptail --title 'Welcome to the openHABian Configuration Tool [master]v1.6-alpha-845(116468c)' --menu 'Setup Options' 18 116 11 --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 ►'
+ choice=
+ RET=1
+ '[' 1 -eq 1 ']'
+ return 255
+ system_check_default_password
+ 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
+ local algo
+ local defaultPassword
+ local defaultUser
+ local generatedPassword
+ local introText
+ local originalPassword
+ local salt
+ 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
+ id -u pi
+ 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
+ defaultUser=openhabian
+ defaultPassword=openhabian
++ grep -w openhabian /etc/shadow
++ cut -d: -f2
+ originalPassword='$6$Oa2jE7q9LCf2pwQg$CLetQr8dlemHVGxr9.wbHNvBb6ka.UdH.8usMFy8XpTqxGP15mVAkART3WMCVWhNCWoGU7kJFpwyuyp1EpmpQ1'
++ echo '$6$Oa2jE7q9LCf2pwQg$CLetQr8dlemHVGxr9.wbHNvBb6ka.UdH.8usMFy8XpTqxGP15mVAkART3WMCVWhNCWoGU7kJFpwyuyp1EpmpQ1'
++ cut '-d$' -f2
+ algo=6
+ introText='The default password was detected on your system! That is a serious security concern. Bad guys or malicious programs in your subnet are able to gain root access!\n\nPlease set a strong password by typing the command '\''passwd openhabian'\''!'
++ echo '$6$Oa2jE7q9LCf2pwQg$CLetQr8dlemHVGxr9.wbHNvBb6ka.UdH.8usMFy8XpTqxGP15mVAkART3WMCVWhNCWoGU7kJFpwyuyp1EpmpQ1'
++ cut '-d$' -f3
+ salt=Oa2jE7q9LCf2pwQg
+ export algo defaultPassword salt
++ perl -le 'print crypt("$ENV{defaultPassword}","\$$ENV{algo}\$$ENV{salt}\$")'
+ generatedPassword='$6$Oa2jE7q9LCf2pwQg$9HTAmBlN7dLelML.38m4zn0c87LbiBI6xQjDcD5xAeCDQQuMxeD6a3ueqs8x2w13Kogedhqd.gVsgbQ96lNM71'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2020-09-23_15:25:40_CEST [openHABian] Checking for default openHABian username:password combination... '
2020-09-23_15:25:40_CEST [openHABian] Checking for default openHABian username:password combination... ++ id -u openhabian
+ [[ -n 1000 ]]
+ [[ $6$Oa2jE7q9LCf2pwQg$9HTAmBlN7dLelML.38m4zn0c87LbiBI6xQjDcD5xAeCDQQuMxeD6a3ueqs8x2w13Kogedhqd.gVsgbQ96lNM71 == \$\6\$\O\a\2\j\E\7\q\9\L\C\f\2\p\w\Q\g\$\C\L\e\t\Q\r\8\d\l\e\m\H\V\G\x\r\9\.\w\b\H\N\v\B\b\6\k\a\.\U\d\H\.\8\u\s\M\F\y\8\X\p\T\q\x\G\P\1\5\m\V\A\k\A\R\T\3\W\M\C\V\W\h\N\C\W\o\G\U\7\k\J\F\p\w\y\u\y\p\1\E\p\m\p\Q\1 ]]
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -e '2020-09-23_15:25:40_CEST [openHABian] We hope you got what you came for! See you again soon ;)'
2020-09-23_15:25:40_CEST [openHABian] We hope you got what you came for! See you again soon ;)
+ cd /home/openhabian
[15:25:40] root@ohab2:/home/openhabian# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 29.7G 0 disk
├─sda1 8:1 1 256M 0 part
├─sda2 8:2 1 14.6G 0 part
└─sda3 8:3 1 14.9G 0 part /storage
sdb 8:16 1 1006M 0 disk
└─sdb1 8:17 1 1003M 0 part /media/influxdbstick
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
[15:30:32] root@ohab2:/home/openhabian# blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="d0c18a5b-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="d0c18a5b-02"
/dev/sdb1: UUID="fbbff3f2-ab8d-d601-f017-f3f2ab8dd601" TYPE="ext4" PARTUUID="eeaebe6d-01"
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4AD7-B4D5" TYPE="vfat" PARTUUID="8a35ae9d-01"
/dev/sda2: LABEL="rootfs" UUID="2887d26c-6ae7-449d-9701-c5a4018755b0" TYPE="ext4" PARTUUID="8a35ae9d-02"
/dev/sda3: UUID="96264c72-eb4e-4700-ba97-2acfbda2eeaf" TYPE="ext4" PARTUUID="8a35ae9d-03"
/dev/zram0: LABEL="zram-config0" UUID="95527eb2-fd5e-4b63-aa91-d1d839f095b8" TYPE="swap"
/dev/zram1: UUID="c323b28d-76de-49b3-be89-d98348c28fa4" TYPE="ext4"
/dev/zram2: UUID="ebe2850a-64f3-448d-8ee4-841014de1249" TYPE="ext4"
/dev/mmcblk0: PTUUID="d0c18a5b" PTTYPE="dos"
reboot now?
show earlier lines. Did the dd commands complete ?
Re-download backup.bash
before you try again.
sorry, i copied the previous lines to a txt file and forgot to paste that part… previous post should now be complete.
again?
download yes but no need to re-run
it looks fine to me now.
Is sdc3 /storage ok?
You could try to install Amanda there via menu now.
it’s /dev/sda3 but it’s mounted:
[17:08:54] root@ohab2:/opt/openhabian/functions# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 29.7G 0 disk
├─sda1 8:1 1 256M 0 part
├─sda2 8:2 1 14.6G 0 part
└─sda3 8:3 1 14.9G 0 part /storage
...
re-installing amanda now.
someday you’re gonna have to assist me setting up exim4 btw
[17:12:04] backup@ohab2:~$ touch /storage/amanda/file
touch: cannot touch '/storage/amanda/file': Permission denied
[17:15:15] backup@ohab2:~$ ls -la /storage/amanda/
total 8
drwxr-xr-x 2 root root 4096 Sep 23 17:11 .
drwxr-xr-x 5 root root 4096 Sep 23 17:11 ..
should i change owner (user backup
?), i don’t think this part from openhabian/amanda docs doesn’t apply, right?
If that does not work as expected (to produce a file that is owned by the
backup
user), you need to change export options on your NAS/NFS server. See also paragraph onno_root_squash
above.
It`ll do that itself on install.
no this mount is local not NFS
ok, as you said…
but now /var/log/amanda/server/
does not exist. it existed 2 days ago when i amanda was running as expected… created [19:54:56] openhabian@ohab2:~$ sudo mkdir /var/log/amanda/server
, chown backup:backup and now it seems to work again… amdump running now.
no idea where /var/log/amanda/server/
didn’t exist anymore.
There’s an improved version available (update master branch).
Your version would probably fail to boot properly when you exchange cards.
Use menu 53 to test. Beware it’ll erase your Amanda installation.