Openhabian based SD card clone - doesn't boot

Have you looked at this link https://beebom.com/how-clone-raspberry-pi-sd-card-windows-linux-macos/

It has worked for me in the past.

Also, why not make a backup, install a fresh image, then restore from your backup?

Make a Backup

openhab-cli backup --full
Move the backup zip file to PC or other device.

To restore the backup:

Place the backup zip file into the backups folder 

then,

sudo systemctl stop openhab2.service
openhab-cli restore /path/to/zipped/backup (var/lib/openhab2/backups)
sudo systemctl start openhab2.service

This will backup /etc/openhab2/ and /var/lib/openhab2/
This way, the information about installed addons is backuped, but not the addons itself, so when installing openhab2 new, the actual version of the bindings will be installed.
The only things to backup in addition, are the manually installed addons.

Thanks for sharing. I tried the described “dd” commands unter MacOS instructions. --> Pi didn’t boot… no blinking LED nothing…
The strange thing is that I only see the marked partition 0 in the MacOS related screenshot on the openhabian based SD card.

I make regular backups of openhab with the backup script - but I also want to capture the configurations and installations outside openhab (like USB/serial client).

Sounds like a Pi issue.:expressionless: Did you try installing a different OS on the same SD card and Pi to see if that worked?

You can also manually backup those then reinstall afterwards.

Here’s another link that may help with using dd https://linux.die.net/man/1/dd

No, this would kill my running openhabian installation :wink: currently Pi boots fine with my productive SD Card running openhabian. If I clone this card to another SD card the Pi is silent…
But could give it a try with another SD and totally different OS installation…

@bernd_d Did you ever set the Pi to boot from external mass storage?

If not sure check the /boot/config.txt and see if program_usb_boot_mode=1 is there. Or this command showing

$ vcgencmd otp_dump | grep 17:
17:3020000a

would indicate the OPT has been set to boot with without SD card.

No, I have not activated boot from external mass storage.

Here’s a topic that worked for another user. SD Clone - Have anyone tried the SD Cloner? - #5 by Yoinkz

@H102 Are you using an openhabian Image? What happens when you put it in your SD card reader? Is it mounted and do you see all partitions or do you also get a notification that it can not be mounted ?
(only partition 0 visible by using e.g. diskutil list)

I’m using linux OS and I can see all partitions and no message about mounting error.

Try using something like GParted (or other partition tool) to see if you can view the files.

@bernd_d it kinda sounds like the SD card is bad.:thinking: I still think it’s worth a shot to install raspbian or some other OS on SD card and see if that will work in your Pi. At least this will prove the SD card is good.

Will give it a try with a raspbian on this SD Card and maybe try another new SD card for the openhabian based image…

While I wait for a new my SD Card to be delivered:
Is it normal that the openHABian based SD-Card (that boots in my Pi) can not be mounted in a Mac while I can mount and see the files from another “non-openhabian image” installed Pi Card ?

Or is just the SD Card crap and I’m lucky that my openhabian boots in the Pi at all? :face_with_raised_eyebrow:

Dunno a Mac’s capabilities in terms of file systems, but the openHABian image is just standard, i.e. ext4 and a FAT-32 boot partition.

1 Like

Not familiar with Mac either and agree with @mstormi about it being a standard ext4 and FAT-32.

Do you have another OS to try with?

@mstormi This is what worries me at my current installation setup. I got new SD Cards, tried with another one to restore the openhabian based image. Same result. Doesn’t boot. If I check the paritions on the running openhabian sd card I see this:

If I check the SD Card of another PI (regular Jessie based image) I see more:

So it looks like some partitions do not show up in the openhabian based image, although the sd card boots, but not if I create another one with this image… :thinking:

What partitions do you see on your openhabian based sd card?

Like I already said, an ext4 and a FAT-32 boot partition.
Don’t understand what you mean by “openhabian image restore” but if you flash the (original) openHABian 1.5 image to an SD (and have not messed with your Pi’s firmware), it’ll boot.
So if yours does not use a different tool to flash (such as Etcher on Windows or dd on the Pi itself)

[17:32:59] root@openhabianpi:/home/openhabian# fdisk -l /dev/sda
Disk /dev/sda: 14,9 GiB, 15931539456 bytes, 31116288 sectors
Disk model: STORAGE DEVICE
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xfc7531cb

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192    93236    85045 41,5M  c W95 FAT32 (LBA)
/dev/sda2       94208 14774271 14680064    7G 83 Linux
1 Like

Yes, the Fat-32 boot partition can’t be seen on the openhabian sd card. I wonder why it boots on the Pi. :wink: Unfortunately the clone of the sd card looks the same - but this can’t boot…
What I meant with “image restore” was that I tried to clone the productive / running openhabian installation by capturing an image of the configured environment.

@H102 @mstormi thank you for your feedback and food for thoughts.

I finally made it - it turned out that with the new SD card it seemed to be the same issue. So I tried with another SD card reader - using the micro sd card adapter that is shipped with the cards. My “old” card reader supposed to be able to write to micro sd card directly without an adapter but it turned out that the last several clones I created that way didn’t contain a bootable partition (etcher warned here, applepibaker didn’t…).

It looks like the combination of using the micro sdcard adapter with another sd card reader helped.

Thanks again for your thoughts!
Regards, Bernd (who isn’t nervous about the backup anymore :wink: )

1 Like

If that’s what you’re after, why don’t you use Amanda ? openhabian-config option 51

Up to now I made the openhabian configuration backups by using the backup script provided in
$OPENHAB_RUNTIME/bin/backup
The sd card clone in addition is to capture the other native Pi related configurations / installations / settings over the years…

It looks like amanda can do an sd card clone as well - thanks for the link!