Creating my first image....needing help

Hey all! First off, just warning you that I’m very, VERY new/green with Mender. So please find my ignorance charming. :slight_smile:

We are looking into Mender for an IoT project. Our endpoints aren’t Raspberry Pi’s but Dell Gateway devices with x86/64 processors running Ubuntu 20.04. We have a Mender demo server running as a docker image on an Ubuntu VM on a Proxmox host. For proof-of-concept before we try on a Gateway device we are trying to create a Mender image from a small Ubuntu 20.04 VM (1vCPU/2GB RAM/32GB disk). I am running mender-convert on a separate Ubuntu 20.04 VM. I’m using the following Mender Hub entry as a guidance on what to do:

…but of course, it’s not an Intel NUC or Ubuntu 18.04 but I imagine the steps are still very similar.

Built a vanilla Ubuntu server VM, UEFI, no LVM, no mender client installed, and ran the following command to make a copy of the image to a separate disk:

dd if=/dev/sda of=/mnt/ubuntu2004_uefi_noLVM.img bs=1M conv=fdatasync

I also created another image file without the conv option:

dd if=/dev/sda of=/mnt/gubuntu2004_uefi_noLVM_2.img bs=1M

Ran the following command against the .img file:

sgdisk -e /mnt/ubuntu2004_uefi_noLVM.img

And here’s the output if you run fdisk against the img file:

root@dsnfs:/share/spare# fdisk -l ubuntu2004_uefi_noLVM.img
Disk ubuntu2004_uefi_noLVM.img: 32 GiB, 34359738368 bytes, 67108864 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: D3BD18A8-D554-4CA9-A594-C98206F397BB

Device                       Start      End  Sectors  Size Type
ubuntu2004_uefi_noLVM.img1    2048  1050623  1048576  512M EFI System
ubuntu2004_uefi_noLVM.img2 1050624 67106815 66056192 31.5G Linux filesystem

Copied both .img files to my Ubuntu utility server. From here, I ran the following mender-convert command from within the mender-convert directory:

root@dsnfs:/share/spare/mender-convert# MENDER_ARTIFACT_NAME="release-1" ./mender-convert --disk-image input/ubuntu2004_uefi_noLVM_v2.img --config configs/generic_x86-64_hdd_config --overlay /share/spare/mender-convert/rootfs_overlay_demo

But I am running into the following error (complete screen capture is shown, this is from the other .img file but I received the same error on both .img files created):

Running mender-convert-extract: --config ./work/override_compression_config --disk-image input/ubuntu2004_uefi_noLVM_v2.img --config configs/generic_x86-64_hdd_config --overlay /share/spare/mender-convert/rootfs_overlay_demo
2022-10-14 15:11:00 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2022-10-14 15:11:00 [INFO] [mender-convert-extract] Using configuration file: ./work/override_compression_config
2022-10-14 15:11:00 [INFO] [mender-convert-extract] Using configuration file: configs/generic_x86-64_hdd_config
2022-10-14 15:11:00 [INFO] [mender-convert-extract] Validating disk image
2022-10-14 15:11:00 [INFO] [mender-convert-extract] Disk parsed successfully
2022-10-14 15:11:00 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: gpt
2022-10-14 15:11:01 [INFO] [mender-convert-extract] PART 1: SIZE: 512M TYPE: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
2022-10-14 15:11:01 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs
2022-10-14 15:11:04 [INFO] [mender-convert-extract] PART 2: SIZE: 31.5G TYPE: 0fc63daf-8483-4772-8e79-3d69d8477de4
2022-10-14 15:11:04 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs
mender-convert-extract has finished. Cleaning up...
Running mender-convert-modify: --config ./work/override_compression_config --disk-image input/ubuntu2004_uefi_noLVM_v2.img --config configs/generic_x86-64_hdd_config --overlay /share/spare/mender-convert/rootfs_overlay_demo
2022-10-14 15:17:20 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2022-10-14 15:17:20 [INFO] [mender-convert-modify] Using configuration file: ./work/override_compression_config
2022-10-14 15:17:20 [INFO] [mender-convert-modify] Using configuration file: configs/generic_x86-64_hdd_config
2022-10-14 15:17:24 [INFO] [mender-convert-modify] Installing Mender client and related files
2022-10-14 15:17:24 [INFO] [mender-convert-modify] Installing Mender client version latest
2022-10-14 15:17:25 [INFO] [mender-convert-modify] Successfully downloaded mender-client_3.4.0-1+ubuntu+focal_amd64.deb
2022-10-14 15:17:25 [INFO] [mender-convert-modify] Successfully installed mender-client_3.4.0-1+ubuntu+focal_amd64.deb into /share/spare/mender-convert/work/rootfs/
2022-10-14 15:17:25 [INFO] [mender-convert-modify] Creating state folder in the data partition for Mender add-ons
2022-10-14 15:17:25 [INFO] [mender-convert-modify] Not installing GRUB EFI bootloader, relying on platform provided one.
2022-10-14 15:17:25 [INFO] [mender-convert-modify] Installing Mender GRUB tools...
2022-10-14 15:17:25 [INFO] [mender-convert-modify] Installing the GRUB editenv binary
2022-10-14 15:17:26 [INFO] [mender-convert-modify] Generating grub config using update-grub...
mender-convert-modify has finished. Cleaning up...
2022-10-14 15:17:29 [ERROR] [mender-convert] mender-convert failed
2022-10-14 15:17:29 [DEBUG] [mender-convert-modify] When running: (modules/ run_and_log_cmd_noexit():  

	sudo chroot work/rootfs grub-install --removable --no-nvram
	Disabling OS prober in offline mode...
Cannot probe device in command line: --target=fs_uuid --device /dev/sda3
grub-install: error: /usr/lib/grub/i386-pc/ doesn't exist. Please specify --target or --directory.

2022-10-14 15:17:29 [ERROR] [mender-convert] mender-convert exit code: 1

I’ve created Ubuntu 18.04 and Debian 11.5 VMs and receiving the same error, so I’m not sure if it’s the way I laid out the OS, the VM medium, the dude behind the keyboard lol…

Hello @UghWhyMe,

I don’t think there is any problem with the steps themselves; I followed them and it works for me.

I think the problem is in your workstation, can you check you have all the dependencies?

You can check the requirements-deb.txt file as described in our docs:

If you are using a debian-based OS in your workstation, the following command should work:

sudo apt install $(cat requirements-deb.txt)

Another option to avoid installing additional software in your workstation: did you try using docker-mender-convert instead of mender-convert alone? Just don’t forget to build the docker image first with ./docker-build.

Still I have some comments so far:

  • Is there any reason you are using the root user for running mender-convert? This is not necessary and I would avoid it if possible. Still this is unrelated with your problem.

  • In the tutorial you shared with me, they are using 2.2.x branch, did you try with the newest one 3.0.x? If not, just use -b 3.0.x in the git clone command. You can also switch the branch and pull for updates.

Have a great day!

1 Like

Well, I felt like I missed some details…guess I did. :slight_smile:

I installed mender-convert v3.0.4:

git clone -b 3.0.1

I did run the deb-requirements.txt and also had to install an additional package on my Ubuntu 20.04 utility server - build-essentials - for the ‘ar’ command that mender-convert uses.

And I got the same error while running normal and dockerized mender-convert.

Could it be something with 20.04 in itself? Is there a specific way to lay out the OS before trying to convert it?


Maybe just a typo, but the command you gave clones 3.0.1, not 3.0.4.


@UghWhyMe I just noticed this thread and it seems like it is the same issue that you are facing. Can you check if the advice given by @kacf solves your problem?