Hey all! First off, just warning you that I’m very, VERY new/green with Mender. So please find my ignorance charming.
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/grub.sh:114): 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/modinfo.sh 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…