Kernel panic after restoring an image-backup

I hope someone can help me with my problem…

I’m using openhab since a couple of years, but on friday I did a systemupdate via openhabian-config (just pulled the latest software, no upgrade to testing-branch or something else). When the openhab2-service was restartet (an update of java caused it) all my things were gone. All items still there, but no more things, the inbox found some things I had used. After rebooting the whole raspi the same result.
“No Problem” I thought to myself “you have your card-backups for that”.
Before updating I shut down the raspi, pull out the card, put it into an sdcard-reader at the laptop und do a full backup with

sudo dd bs=512 status=progress if=/dev/sdb conv=sync,noerror count=14811135 | gzip -c | sudo dd of=/home/ronaldo/,
put the card back into the raspi und it boots normally.
Now I wrote back the last image to the card (with dd and with etcher) and after booting it I got a kernel panic.
Trying another card (probably its corrupt)… same result… tried the backup before the last (on both cards)… same result. :frowning:
I used google and tried out some things but now I’m at the end… so hopefully someone can lead me.

Both partitions (boot and rootfs) seem to be normal (all files should be there).

[ronaldo@RonaldosPC ~]$ sudo fsck -y /dev/sdb1 fsck von util-linux 2.36.1 fsck.fat 4.1 (2017-01-24) /dev/sdb1: 217 files, 45733/84261 clusters
The first time after writing the card it says only, that it was not unmounted correctly.

[ronaldo@RonaldosPC ~]$ sudo fsck -y /dev/sdb2 fsck von util-linux 2.36.1 e2fsck 1.45.6 (20-Mar-2020) rootfs: sauber, 115686/473280 Dateien, 1372877/1939456 Blöcke

[ronaldo@RonaldosPC ~]$ sudo blkid /dev/sdb1: LABEL_FATBOOT="boot" LABEL="boot" UUID="5DB0-971B" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="5e962008-01" /dev/sdb2: LABEL="rootfs" UUID="060b57a8-62bd-4d48-a471-0d28466d1fbb" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5e962008-02"
The cmdline.txt on /boot looks like:

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=5e962008-02 rootfstype=ext4 elevator=deadline rootwait

Is it possible to rescue the image without setting up all from the beginning?

  • Platform information:

A list of tips / instructions is listed in this thread:

In case you can mount the partitions on your PC runing linux then I think you should be able to create a backup of the necessary files that belong to OH. Have a look to the backup script that creates a zip file.

I found this thread via google but exactly this is the point where I’m stuck. :frowning:

Are you able to mount the OH linux partition ?
My suggestion would be to create a back of the OH configuration files ( files/directories ) to be identified by the OH backup script.
I think this is less trial and error especially in case something goes wrong during trials to fix it.

O.K., Thanks to all hints.
I did a fresh setup with the latest Openhabian-Image. I copied the related files from openhab, grafana, influxdb and mosquitto from the /var/lib-folder out of the image, also the oh-files from /etc.
After the final boot of the new image and mosquitto, influxdb and grafana was installed I copied back the files, corrected the owner and permissions. Then had some trouble while starting OH with many Java-Errors… installed Zulu 11, reinstalled OH via config-tool and cleaned the cache from systemctl oh.service.
Except the Zigbee-Dongle all is working so far. :smiley:
Firstly after that I ran the OH-Backup-Script. :wink:
Next step after bringing up Zigbee is creating and testing SD-Card image-backups on other cards. :wink:

But still the great question for me is: “Why didn’t all my sdcard-images work?”