[openhabian 1.6.5] Raw SD copy not producing a booting SD due to set-partuuid: command not found

  • Platform information:
    • Hardware: Raspberry pi v3 b

I am trying to set-up OH3.1 on my raspberry starting from the openhabian image, strictly following the instructions in the docs.

I downloaded the last available image (1.6.5) from this page. After burning the SD I only modified the hostname and set the wifi in openhabian.conf, because in my development raspberry i use wifi and not ethernet.

The installation proceeds correctly and I end up with a working OH3 instance.

I then connect to the raspberry an SD reader with another 16Gb SD card (same size as the one with openhab). This is the only device attached to the raspberry. The sd appears as /dev/sda1 and /dev/sda2 (it was already used with an older version).

In openhabian-config I select option 54 Raw copy SD . The copy takes approximately 30minutes. At the end the openhabian-config menu re-appears.

After the copy I tried to boot from the copied SD card but the raspberry is not reachable. Connecting the raspberry to the screen during boot it shows some message that it is waiting for partuuid=-02 and it stays there.

I performed the raw copy again setting debug to maximum in /etc/openhabian.conf, this time.

The following error appears in the terminal window, after the 30minutes copy,

/opt/openhabian/functions/helpers.bash: line 31: set-partuuid: command not found

I searched the forum for the previous error and found the following thread from september 2020.

Based on the suggestions of that thread I performed the following

  1. copy set-partuuid from /opt/openhabian/includes/SD to /usr/local/sbin (note in the thread it was in includes not includes/SD)
  2. I issued the command set-partuuid /dev/sda2 random (which was exactly the command that I saw in the opehnabian-config log). As in the aforementioned thread, I was asked to agree to the installation of gdisk.

gdisk not installed

Ok to install gdisk (y/n)? y

Installing gdisk

  1. after the installation of gdisk I tried again option 54 Raw copy SD .
    After the 30minutes copy, the previous error did not appear.

  2. This time, after swapping the SD card, the raspberry is reachable again. So, I solved my problem for now.

I would conclude that the present version of the openhabian image (1.6.5 released on 6 may 2021) does not correctly install “set-partuuid”.
Is this conclusion correct?

EDIT: I am using the recommended “OpenHAB3” branch of openhabian and not the “main” one. I have not tested if this error occurs also in the “main” one.

Yes.
That happens when you select option 53 which would be a natural thing to do before you select 54.

It should also happen towards the end of an unattended initial installation. Do you still have the /boot/first-boot.log to check?

Did you check if the binary was in /usr/local/sbin ? Was it in the path ?

I have not set up the backup in openhabian.conf. In fact, the only relevant line in the first-boot.log is

2021-09-04_22:10:51_CEST [openHABian] Setting up automated SD mirroring and backup... SKIPPED (no configuration provided)

Before copying I checked that directory and it was not there. Evidently it was not in the path because it was giving the error command not found. After I copied it the command was recognized. I never altered the path.

Does this mean that, in order to do a raw SD copy of the main SD (option 54) without manually installing set-partuuid, I have to select first option 53 (Set up mirroring)?

If this is true, I have probably mis-interpreted the documentation. I was thinking that option 53 was requiring a 32Gb SD (twice the main SD) for a periodic backup while option 54 was for one-time copying the main SD to an equal size one (independently of option 53).

Re-reading the docs and based on your comment now the use case seems to be: first set-up the backup sd card with option 53 (with an SD twice as big), then use option 54 and a second sd reader with another 16Gb SD to copy from the backup SD (not the main SD) to this new SD.
Is this true?

You will want 53 instead of 54 because it also sets things up to permanently take care of updating the mirror, then calls 54 as well.
The 2nd SD does not need to be twice as big, that is only a recommendation when you want to also use the card as a backup storage for Amanda. Mirroring only should work with an equal sized card.

PS: I have moved the installation of set-partuuid to the top of the routine so it should get always installed.
PPS: only in main of course

Thank you for your answers.

I have tried to use option 54 to copy from the 32Gb SD card to a new 16Gb card, using a second SD card reader but I was only offered the option to copy the main SD card to either the 32 Gb backup card or the new 16Gb card.
Is this still due to the fact the I am on the “openHAB3” branch of openhabian and not on the “main” branch?

You are confusing me now. You attached two readers ?
openHAB3 branch has not changed.
Either way 32->16 will not work for obvious reasons.

Yes. This is how I interpreted this paragraph of the documentation, for sure in a wrong way

Should you need to switch over to your backup card, get another new SD card that matches the size of the broken card and use menu option 54 to copy your active backup card back to the new one and switch cards back as soon as possible.

In my understanding: “The active backup card” is the 32gb one (I think the partition containing the copy the main SD card), which should be connected with one SD reader; then “another new SD card” is a 16GB one attached with a second reader and the system still run with the old SD card.

Now I understand the meaning. I am not a native english speaker but I think it would be helpful to add some more explicit informations. Let me suggest something like this

In case of main SD failure you can replace the broken SD card with your backup card, but you are advised to do this only temporarily. Get another new SD card that matches the size of the broken card and use menu option 54 to make a copy of the booted SD card (i.e. your backup card from which you booted) to the new one and swap cards back as soon as possible. In this way all the mirroring and backup will continue as before.

Yes. But docs said “SD card” not “SD card reader”.
But it’s good to get feedback, thanks. I’ve adjusted the docs a little.