Unable to convert images using Mender-Convert

  1. While trying out mender-convert with 2.3 release,
  • First my input Debian 9.8 buster image (followed the recommended steps to copy the contents into golden-image-1.img) and given input to mender-convert.
  • Here am trying it for Demo Server, so ran ./scripts/test/run-tests.sh –output-dir ${PWD}/rootfs_overlay_demo/ --tenant-token “dummy”
  • The next step given is MENDER_ARTIFACT… Output is [FATAL] [mender-convert-extract] Sorry but the provided option is not supported: --overlays, tried removing the overlays options as well.

Along with that attaching image for more understanding! Whether it should generate some files in “rootfs_overlay_demo”, which’ll support artifacts for the convert?

  1. In the latest release 2.3, Here my target is of amd64 and Debian OS, which configuration file I should use while converting?
  2. Which lower version of mender supports mender-convert, if I want to try this feature of mender?

You should not use this to build images.

It looks to me that your golden-image-1.img is not a valid image. Can you run fdisk -l golden-image-1.img and share the output?

Also please do not post pictures of logs and instead copy/paste the text. Makes it much easier to read/search.

Disk golden-image-1.img: 5.5GiB, 5883191296 bytes, 11490608 sectors
unit sectors of 1 * 512 = 512bytes
Sector Size (logical/physical): 512 bytes / 512 bytes
I/O Size (minimum/optimal): 512 bytes / 512 bytes

is what been displayed, when i executed the command!

There is definitely something wrong with this image. It should show a valid partition table and at least 1 partition.

As per your suggestion I did it with “if=/dev/sdb” and after that checked with command “>> fdisk -l golden-image-1.img”, generated image
Output:

Disk golden-image-1.img: 14.6 GiB, 15631122432 bytes, 30529536 sectors
               unit sectors of 1 * 512 = 512bytes
               Sector Size (logical/physical): 512 bytes / 512 bytes
               I/O Size (minimum/optimal): 512 bytes / 512 bytes
              Disklabel type: dos
              Disk identifier: 0x1ce243a8

              Device                                 Boot          Start             End        Sectors     Size   Id  Type
              golden-image-1.img1       *                2048   22468607  22466560  10.7G  83 Linux         
              golden-image-1.img2                22470654   30527487    8056834    3.9G    5  Extended
              golden-image-1.img5                22470656   30527487    8056832    3.9G   82 Linux Swap / Solaris

I think these are partition table should exist in the image, assuming it is correct now. So, I have proceeded with mender-convert 2.3 version with this command

MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo

Output: Running mender-convert: --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo
               Running mender-convert-extract: --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo
               [Date and TimeStamp] [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
               [Date and TimeStamp] [INFO] [mender-convert-extract] Using configuration file: configs/ raspberrypi3_config
               [Date and TimeStamp] [INFO] [mender-convert-extract] Validating Disk Image
               [Date and TimeStamp] [INFO] [mender-convert-extract] Disk Parsed Successfully
               [Date and TimeStamp] [INFO] [mender-convert-extract] NUMBER OF PARTS: 3 TYPE: dos
               [Date and TimeStamp] [INFO] [mender-convert-extract] PART1: SIZE: 10.7G TYPE: 0x83
               [Date and TimeStamp] [INFO] [mender-convert-extract] PART1: extracting to work/part-1.fs
               [Date and TimeStamp] [INFO] [mender-convert-extract] PART2: SIZE: 3.9G TYPE: 0x5
               [Date and TimeStamp] [INFO] [mender-convert-extract] PART2: extracting to work/part-2.fs
               [Date and TimeStamp] [INFO] [mender-convert-extract] PART3: SIZE: TYPE: 
               [Date and TimeStamp] [INFO] [mender-convert-extract] PART3: extracting to work/part-3.fs
               Modules/disk.sh: line 61: $4: unbound variable

This error is seen on the terminal window. Then I checked particular line of script file “Modules/disk.sh”, here I assume “$4” is for writing of output files i.e. deploy folder as per the instructions, which isn’t happening, So I tried modifying the line in the script file i.e. run_and_log_cmd “dd if=$1 of=/media/user_name/external_HDD/folder_name/mender-convert skip=$2 bs=512 count=$3 conv=sparse status=none” Since it is looking for a path to write output files.

After this modification I ran the mender-convert command again and checked, received this error

Output: Running mender-convert: --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo
               Running mender-convert-extract: --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo
               [Date and TimeStamp] [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
               [Date and TimeStamp] [INFO] [mender-convert-extract] Using configuration file: configs/ raspberrypi3_config
               [Date and TimeStamp] [INFO] [mender-convert-extract] Validating Disk Image
               [Date and TimeStamp] [INFO] [mender-convert-extract] Disk Parsed Successfully
               [Date and TimeStamp] [INFO] [mender-convert-extract] NUMBER OF PARTS: 3 TYPE: dos
               [Date and TimeStamp] [INFO] [mender-convert-extract] PART1: SIZE: 10.7G TYPE: 0x83
              Dd: failed to open ‘/user_name/external_HDD/folder_name/mender-convert’: No such file or directory

Just to ensure, given all write permissions to this folder as well.

Please give your inputs on this, whether I have missed any step before executing the mender-convert command.

Edit: @mirzak: formatting

It seems to have problems with identifying the swap partition,

[Date and TimeStamp] [INFO] [mender-convert-extract] PART3: SIZE: TYPE: 
[Date and TimeStamp] [INFO] [mender-convert-extract] PART3: extracting to work/part-3.fs

Which then leads to the error. But I see other problems with your input disk image,

  1. mender-convert will assume that the first partition is the boot partition (I do not think this is the case in your image)
  2. mender-convert will assume that the second partition is the rootfs (I do not think this is the case in your image)
  3. mender-convert is not able to handle swap partitions

So without making modifications to mender-convert I do not think that your image will work.

A typical image that mender-convert is able to handle looks like this,

$ fdisk -l Ubuntu-Bionic-x86-64.img 
Disk Ubuntu-Bionic-x86-64.img: 2,12 GiB, 2270532608 bytes, 4434634 sectors
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: gpt
Disk identifier: 3B4BAD4E-D5CB-5F40-B03D-7BBF5F306C3E

Device                     Start     End Sectors  Size Type
Ubuntu-Bionic-x86-64.img1   2048  526335  524288  256M EFI System
Ubuntu-Bionic-x86-64.img2 526336 4434600 3908265  1,9G Linux root (x86-64)

As you mentioned about modifications needed in mender-convert, Requesting you to provide/guide me on those changes which will help support in generating 4 partition image.

Do you have any other suggestion for debian 9.8 OS.

Hi @Sash you are using the raspberrypi3_config file which is expecting the extra FAT partition that is needed for that platform. You will need a different config file at a mimimum here. I suggest you start with the Beaglebone config files as they use Debian. But they may also use the FAT partition so you will need to adjust that.