# Creating my first image....needing help

**URL:** <https://hub.mender.io/t/creating-my-first-image-needing-help/5322>\
**Category:** General Discussions\
**Created:** [October 17, 2022, 3:55pm UTC](https://hub.mender.io/t/creating-my-first-image-needing-help/5322 "2022-10-17T15:55:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![UghWhyMe](https://avatars.discourse-cdn.com/v4/letter/u/8edcca/32.png) [@UghWhyMe](https://hub.mender.io/u/UghWhyMe)\
**Post date:** [October 17, 2022, 3:55pm UTC](https://hub.mender.io/t/creating-my-first-image-needing-help/5322/1 "2022-10-17T15:55:55Z")

</div>

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:

> [@INTEL NUC x86-64 Ubuntu 18.04](https://hub.mender.io/t/intel-nuc-x86-64-ubuntu-18-04/2214):
>
> Board description The Intel® NUC is a powerful 4x4-inch mini PC with entertainment, gaming, and productivity features, including a customizable board that is ready to accept the memory, storage, and operating systems that you want. From fully configured, ready-to-use Mini PCs to kits and boards for do-it-yourselfers, find the Intel® NUC that is right for you. URL: [https://www.intel.com/content/www/us/en/products/boards-kits/nuc.html](https://www.intel.com/content/www/us/en/products/boards-kits/nuc.html) Wiki: [https://en.wikipedia.org/wiki/N…](https://en.wikipedia.org/wiki/Next_Unit_of_Computing)

…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:

```auto
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):

```auto
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…

---

<div class="post-metadata">

**Author:** ![lramirez](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lramirez/32/1195_2.png) [@lramirez](https://hub.mender.io/u/lramirez)\
**Post date:** [October 18, 2022, 2:51am UTC](https://hub.mender.io/t/creating-my-first-image-needing-help/5322/2 "2022-10-18T02:51:26Z")

</div>

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](https://github.com/mendersoftware/mender-convert#using-mender-convert-without-docker) file as described in our docs:

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

```bash
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!  
Luis

---

<div class="post-metadata">

**Author:** ![UghWhyMe](https://avatars.discourse-cdn.com/v4/letter/u/8edcca/32.png) [@UghWhyMe](https://hub.mender.io/u/UghWhyMe)\
**Post date:** [October 18, 2022, 12:12pm UTC](https://hub.mender.io/t/creating-my-first-image-needing-help/5322/3 "2022-10-18T12:12:13Z")

</div>

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

I installed mender-convert v3.0.4:

`git clone -b 3.0.1 https://github.com/mendersoftware/mender-convert.git`

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?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [October 18, 2022, 1:59pm UTC](https://hub.mender.io/t/creating-my-first-image-needing-help/5322/4 "2022-10-18T13:59:37Z")

</div>

@UghWhyMe

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

Greetz

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [October 18, 2022, 7:07pm UTC](https://hub.mender.io/t/creating-my-first-image-needing-help/5322/5 "2022-10-18T19:07:39Z")

</div>

@UghWhyMe I just noticed [this thread](https://hub.mender.io/t/mender-convert-fails-during-grub-install/5280/2) 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?

Greetz
