Error converting RPi4 image to mender "/mender-convert/work/rootfs: wrong fs type, bad option, bad superblock"

Hello,

I was trying to convert a raspberry pi 4 (Raspberry Pi 02 lite 32bit) to mender. The conversion errors out with:

mount: /mender-convert/work/rootfs: wrong fs type, bad option, bad superblock on /dev/loop5, missing codepage or helper program, or other error.

I created the golden image as dd from

Disk: /dev/disk2	geometry: 7764/255/63 [124735488 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0C   64   0   1 - 1023   3  32 [      8192 -     524288] Win95 FAT32L
 2: 83  260   0   1 - 1023  63  32 [    532480 -    5611521] Linux files*
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
BMacBook-Pro:input user$ sudo dd if=/dev/disk2 of=sb-no-mender-golden-0.5.1.img bs=512 count=6135810

running:

Running mender-convert --disk-image input/sb-no-mender-golden-0.5.1.img --config configs/raspberrypi4_config
Running mender-convert-extract: --config ./work/override_compression_config --disk-image input/sb-no-mender-golden-0.5.1.img --config configs/raspberrypi4_config
2021-12-31 10:19:47 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2021-12-31 10:19:47 [INFO] [mender-convert-extract] Using configuration file: ./work/override_compression_config
2021-12-31 10:19:47 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi4_config
2021-12-31 10:19:47 [INFO] [mender-convert-extract] Validating disk image
2021-12-31 10:19:47 [INFO] [mender-convert-extract] Disk parsed successfully
2021-12-31 10:19:47 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos
2021-12-31 10:19:47 [INFO] [mender-convert-extract] PART 1: SIZE: 256M TYPE: 0xc
2021-12-31 10:19:47 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs
2021-12-31 10:19:57 [INFO] [mender-convert-extract] PART 2: SIZE: 2.7G TYPE: 0x83
2021-12-31 10:19:57 [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/sb-no-mender-golden-0.5.1.img --config configs/raspberrypi4_config
2021-12-31 10:21:56 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2021-12-31 10:21:56 [INFO] [mender-convert-modify] Using configuration file: ./work/override_compression_config
2021-12-31 10:21:56 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi4_config
mount: /mender-convert/work/rootfs: wrong fs type, bad option, bad superblock on /dev/loop5, missing codepage or helper program, or other error.
mender-convert-modify has finished. Cleaning up...
umount: work/rootfs: not mounted.
2021-12-31 10:21:56 [ERROR] [mender-convert] mender-convert failed
2021-12-31 10:21:56 [DEBUG] [mender-convert-extract] When running: (modules/disk.sh:64): run_and_log_cmd():  

	dd if=input/sb-no-mender-golden-0.5.1.img of=work/part-2.fs skip=532480 bs=512 count=5611521 conv=sparse status=none
2021-12-31 10:21:56 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2021-12-31 10:21:56 [INFO] [mender-convert-modify] Using configuration file: ./work/override_compression_config
2021-12-31 10:21:56 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi4_config
2021-12-31 10:21:56 [ERROR] [mender-convert] mender-convert failed
2021-12-31 10:21:56 [ERROR] [mender-convert] mender-convert exit code: 32
Log file available at: logs/convert.log.uJdMap2DsR

Please advise.

Thanks & very best!

I would start by looking at the image you’ve extracted. Can you get it to mount locally?

@oleorhagen not sure how to mount it locally, but if I flash it onto an SD card using RPI imager, the PI is running fine.

Hmm, that is interesting.

You can mount the filesystem with the mount command, if you’re on linux. And then give it the right offset for the partition you want to mount.