OH3 boot from SD RAW Copy

Hi,

it gives errors and doesn’t boot.
Attached the debug output and cmdline.txt from the external SD card after the raw dump

output.txt (137.3 KB)
cmdline.txt (113 Bytes)

This is why. Possibly because of a problem with your card.
Try that 1st line as a command in the shell.

++ set-partuuid /dev/sda2 random
++ awk '/^PARTUUID/ { print substr($7,1,length($7) - 3) }'
mount: /tmp/set-partuuid-mnt: can't read superblock on /dev/sda2.
++ return 1
+ partUUID=

Hi,

Below the output of the 1st line, no errors:
openhabian@openhab3:~ $ sudo set-partuuid /dev/sda2 random
[sudo] password for openhabian:

Set PARTUUID on /dev/sda2 to random (y/n)? y

PARTUUID on /dev/sda2 is set to e9e1e2a5-02

openhabian@openhab3:~ $

I did again a SD Raw copy but it is still not bootable, so I will try again now with debug maximum to find out what the error is

tried at least 5 times again (SD RAW COPY, menu 54) and it works now properly and I can boot from it.
So very weird that it didn’t do this before.
output.txt (136.7 KB)

My only remaining question for now is the email, it looks likes it cannot find the variable $adminmail , but the MTA has been correctly setup and is working fine as I receive mails every morning about CLI backup.

I noticed in /etc/openhabian.config I can fill in adminmail variable but this gets overwritten each time I open openhabian-config with “John Doe” again.

It should not. Start openhabian-config with debugmode=maximum set to see where it overwrites that. In your debug logs it did not.
There’s a code changing coming up to store it when you entered it during MTA setup, too.

So what I did was:

  • login with openhabian user via Putty
  • change /etc/openhabian.conf and put my e-mail address (replace the John Doe one) “adminmail=my.email@mail.com” (and save the file)
  • sudo openhabian-config
  • in this step my e-mail address is already overwritten by John Doe again and added back in comments. (so “#adminmail=john.doe@foo.bar” iso “adminmail=my.email@mail.com”)
  • the attached output.txt is not showing my e-mail addresss, only John Doe
    output.txt (58.2 KB)

Try this please:
save this code as /opt/openhabian/functions/openhabian.bash and
this as /opt/openhabian/openhabian.conf.dist to your machine.
Do not let openhabian-config update itself on start (that would overwrite them).
Take a copy of your /etc/openhabian.conf then try again what you did last time to produce the eror.

Hi,

I followed your instructions (copying the conf files), then changed adminmail again in etc/openhabian.conf
For testing purposes I commented the 2nd dd in backup.bash to speed up the testing.

I receive emails now and it doesn’t get overwritten anymore in /etc/openhabian.conf

I do get other errors (see below), but don’t know if it’s important:


openhabian@openhab3:~ $ sudo openhabian-config
[sudo] password for openhabian:
2021-01-14_16:51:22_CET [openHABian] Checking for root privileges… OK
/usr/local/bin/openhabian-config: line 84: update_openhabian_conf: command not found
/usr/local/bin/openhabian-config: line 87: config_ipv6: command not found
2021-01-14_16:51:23_CET [openHABian] Loading configuration file ‘/etc/openhabian.conf’… OK
/usr/local/bin/openhabian-config: line 127: openhabian_console_check: command not found
/usr/local/bin/openhabian-config: line 128: openhabian_update_check: command not found
/opt/openhabian/functions/menu.bash: line 43: get_git_revision: command not found
/opt/openhabian/functions/menu.bash: line 216: get_git_revision: command not found
Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card
OK
/opt/openhabian/functions/menu.bash: line 43: get_git_revision: command not found


attached my output.txt
output.txt (55.0 KB)

set clonebranch=conftest and this time let it update itself.
You can insert an “exit 0” before 1st dd.
Remember to always use debugmode=maximum

done,

there was no update on openhabian though
output.txt (42.3 KB)

there should have. Try again and if needed use option 01 to switch to conftest branch

This is what happens when selecting option 01:

and below my output.txt:
output.txt (38.5 KB)

Do I need to undo the changes you proposed earlier first ?
save this code as /opt/openhabian/functions/openhabian.bash and
this as /opt/openhabian/openhabian.conf.dist to your machine.
Do not let openhabian-config update itself on start (that would overwrite them).
Take a copy of your /etc/openhabian.conf then try again what you did last time to produce the eror.

There’s a problem with your ‘patching’: openhabian.bash is broken or does not exist that’s why it does not find the functions defined in there.

You have not set clonebranch=conftest. Do and try again please.

no, updating should overwrite them

If it’s too broken to update do this:

cd /opt/openhabian
git checkout

It’ll tell you about modified files.
You can git checkout -- <file> to recreate a file.
Do this for all modified files until git checkout says it’s done updating.

ok,

I had to to git checkout 3 times until it was ok.
Then I changed to conftest again, it updated :slight_smile:

I opened openhabian again and it immediately has overwritten my email address again with John Doe.

output.txt (183.1 KB)

Read the log (search for e.g. adminmail) and you’ll see what code is executed.
In your log there is no sign of any mail address other than johndoe@… so are you sure you had your address set before starting openhabian-config ?

Here are the steps I did:

  • Open WinSCP (with root)
  • Modify /etc/openhabian.conf to my email address and save the file
    adminmail
  • You can see the modified timestamp below
  • Open Putty and login with user Openhabian
  • script output.txt (for logging purposes)
  • sudo openhabian-conf
  • check /etc/openhabian.conf in WinSCP again, file has been updated again with John Doe
    conf4
  • You can see the modified timestamp below

below also my output.txt
output.txt (56 KB)

So for some reason it is modifying /etc/openhabian.conf directly after I open openhabian-conf, I don’t even select any menu in there, just open, and it looks like the “debug=maximum” is reading openhabian.conf after modifications have been done already.

Edit /opt/openhabian/openhabian.conf.dist and remove the # from the adminmail line then try again.
(You don’t need to select anything in the menu, replacement happens on startup)

Hi,

When modifying the adminmail variable in /opt/openhabian/openhabian.conf.dist and NOT /etc/openhabian.conf then it is not overwritten in /opt and the e-mail is send after the backup

output.txt (96.8 KB)

Stay with clonebranch=conftest and let it update on start then try again please.

remained with conftest, did the update and then backup, email is still my address and I received an email after backup

output.txt (180.1 KB)