Systemd-growfs not growing data partition correctly, but growpart does: symptomatic of a larger issue?

Hello!

I have been able to get Mender to work with my x86 ubuntu 20.04 ROS2 system, and am excited to start using it in the field on our devices.

The simple config that i am using is:

MENDER_STORAGE_DEVICE_BASE=/dev/sda
MENDER_DEVICE_TYPE="x86_64"
MENDER_STORAGE_TOTAL_SIZE_MB=35000

# Nothing to copy
MENDER_COPY_BOOT_GAP="n"

function platform_modify() {
#
# Make sure /lib64 exists since the Mender binary requires it.
# Some systems put everything under /lib (ie Yocto) and a simple
# symlink is enough to find everything Mender needs.
#
if [ ! -e work/rootfs/lib64 ]; then
run_and_log_cmd "ln -s /lib work/rootfs/lib64"
fi
}

This is based off of generic_x86-64_hdd_config.

One thing that I noticed when starting the converted image for the first time is that the data partition is not being grown correctly using systemd-growfs

image

Looking at the logs using

journalctl -u systemd-growfs@data.service

we can see the output being

Oct 18 11:21:35 adi-golden-image systemd[1]: Starting Grow File System on /data...
Oct 18 11:21:35 adi-golden-image systemd-growfs[628]: Successfully resized "/data" to 128.0M bytes.
Oct 18 11:21:35 adi-golden-image systemd[1]: Finished Grow File System on /data.
Oct 18 16:13:44 adi-golden-image systemd[1]: systemd-growfs@data.service: Succeeded.
Oct 18 16:13:44 adi-golden-image systemd[1]: Stopped Grow File System on /data.

Which is showing that the partition is being grown successfully to the default value MENDER_DATA_PART_SIZE_MB : Value: 128 (default)

This is not what i expected since the default value for MENDER_DATA_PART_GROWFS :Values: y(default)/n

On this forum there are multiple posts on the data partition not growing, but one that i found most relevant is Large persistent data partition without large image file - General Discussions - Mender Hub

The last post from @bajo gives a solution for data partition growing by running the following command

sudo growpart /dev/sda 4

This also worked in my case! @bajo then suggest using a custom PLATFORM_MODIFY_HOOK to implement this in a systemd service that is run before systemd-growfs@data.service

Questions

  • While this may work, I am wondering whether the fact that systemd-growfs is not working may be symptomatic of an unknown issue?
  • Is there something that i have not setup correctly ?