we are working on a small project for which we needed a stable way to remotely update our devices ( we are using a Raspberry PI 4) over the air. We decided to use Mender.
I was able to create a bootable Mender Image from the official raspbian image. After that I decided to first install the official raspbian image on an SD card, make all required major changes (installing all required packages, adding the first version of our project,...) and create an image of the SD card.
So.... that did not go well. I was able to make a copy of the SD card and I am able to create an exact copy and run it on another device. But Mender does not recognise it as a bootable image and thus can not convert it.
I used the following command to create the image file:
sudo dd if=/dev/sda2 of=/project/input/custom.img
After trying to convert the image to a valid Mender image I got the following error:
2020-03-09 08:03:22 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2020-03-09 08:03:22 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi4_config
partx: input/custom.img: failed to read partition table
2020-03-09 08:03:22 [INFO] [mender-convert-extract] Validating disk image
2020-03-09 08:03:22 [FATAL] [mender-convert-extract] Sorry, but could not find any valid partitions for: input/custom.img
Since it can not validate the image I assume that there is nothing wrong with the way I try to convert the image into a release but rather the way I create the copy of the SD card. I used the following tutorial to convert the image to a Mender release:
https://hub.mender.io/t/raspberry-pi-4-model-b-raspbian/1312
So my question:
how do I convert an SD card into a bootable image, complete with bootable partition and everything?