Mender convert fails with "cannot overwrite directory"

Hi, I’m trying to convert an existing image using mender-convert for a raspberrypi4

I’m using the official image (generated using the Imager tool) and following the instructions from the Mender docs (here )

However the process is failing with the following message:

mender-convert-modify has finished. Cleaning up...
2022-11-04 15:34:16 [ERROR] [mender-convert] mender-convert failed
2022-11-04 15:34:16 [DEBUG] [mender-convert-modify] When running: (./mender-convert-modify:135): run_and_log_cmd():

        sudo ln -sf /data/mender-configure work/rootfs/var/lib
        ln: work/rootfs/var/lib/mender-configure: cannot overwrite directory

2022-11-04 15:34:16 [ERROR] [mender-convert] mender-convert exit code: 1

I’ve tried to run the process with sudo but it doesn’t appear to be a permissions error, any idea as to what might be causing this and how to fix it?

Thank you for the help, if there’s the need for any further information I’d be happy to provide it

Hi @LorenzoRuffati,

Thanks for getting in touch. So to understand the procedure. You said “existing image” and “generated by the imager tool”. What does that mean? Is it the original Raspbian image that you are starting out with? Or is it an image based on a live system that you have modified?

Greetz,
Josef

Sorry for the confusion, here’s the process:

  1. Use imager to flash a raspberry pi OS image (configured with WiFi, SSH etc)
  2. Boot it with raspberry pi 4, modify some settings using raspi-config and install some programs
  3. Use DD to get an image file (if I understand the terminology this should be called a golden image)
  4. Attempt and fail to convert the golden image as shown in the mender-convert tutorial

Hello @LorenzoRuffati are you still having issues, or were you able to resolve them?

The issue did disappear but I haven’t isolated the solution.

In order of what I believe is the most likely answer it could be any combination of the following:

  1. Increase boot partition size
  2. Increase whole disk size
  3. Reduce the partition size on the raspberry pi before dd-ing to the golden image (I was getting an error about overlapping partition tables)
  4. Run mender-convert in an ext4 partition instead of zfs (seriously doubt it’s this)
  5. Rnning all the operations as root (really really doubt it’s this)

I’m glad it works now.

Please let us know if you figure out what was going on, or if the issue re-appears.