Thanks for the detailed reports @krystof,
To clear some things up on the variables and sizes.
What you list here as 20GB, is the partition size,
18-04_20G.img2 526336 42471390 41945055 20G Linux root (x86-64)
There is a difference between partition size and file system image size. mender-convert does not care much about input partition sizes and will try to re-calculate this based on various variables.
The rootfs partition size is always calculated based on this formula:
rootfs_part_sectors=$(((${disk_image_total_sectors} - ${data_part_sectors} - \
${boot_part_sectors} - ${overhead_sectors}) / 2))
which can be translated to (roughly):
rootfs_part_mb=$(( ${MENDER_STORAGE_TOTAL_SIZE_MB} - ${MENDER_DATA_PART_SIZE_MB} - \
${MENDER_DATA_PART_SIZE_MB} ))
You can specific the rootfs image size using the IMAGE_ROOTFS_*
variables. This is an optimization, as the rootfs image size impacts what is transferred between the Mender server and the Mender client, and this can be less then the actual partition size.
The default rootfs image size will be actual rootfs content * 1.5
(50 % free space relative to actual occupied storage).
If you want the rootfs image size to be the same as the rootfs partition size you can just set:
IMAGE_ROOTFS_SIZE = "-1"
Further, the following is not aligned,
MENDER_STORAGE_TOTAL_SIZE_MB="122104"
Eg I would set it to 122880
which is aligned to 1024
if you want to represent 120GB. This a very large disk :).