We are currently using Yocto to build a distro for a custom board based on the intel-corei7-64 machine arch.
I am looking at Mender to implement an A/B system update feature. I would be using Mender in standalone mode, so no need for the server side or the systemd agent.
Integration has been quite straightforward and I was able to build both the .mender artifact and the .uefiimg initial disk image. However, the SSD we are using is around 1TB, so I ended up with image files between ~500GB and 1000GB large. Most of this would be empty space, as our actual rootfs is only about 10GB.
So, I am currently facing two issues integrating Mender in the production system:
-
Building the .mender artifact takes very long (>1h). This is regardless of the contents and size of the actual rootfs, Most of the time is spent by the
mender-artifact write
command, which has to parse a 500GB .ext4 image.
I managed to somehow work around this by setting theIMAGE_ROOTFS_SIZE
variable to something very small and allow Yocto to calculate it dynamically based on the actual rootfs size.
Otherwise, meta-mender overwrites this withMENDER_IMAGE_ROOTFS_SIZE_DEFAULT
, which is calculated based onMENDER_STORAGE_TOTAL_SIZE_MB
and ends up being around 500GB in my case. -
The.uefiimg is around 1TB, which makes it impractical for an initial deployment using dd. It is true that the compressed version is a lot smaller and easier to transfer around, but actually writing it to disk takes a huge amount of time.
For this I haven’t been able to find a decent work around, other than implementing my own installer that would format the disk and create the corresponding partitions during initial deployment, but I would rather not go that route.
I should mention that I know of the growfs functionality for the data partition, but we keep our data on a separate disk, so ideally I wouldn’t even have a data partition (I set it to 1GB in the config as I didn’t know how to completely remove it).
So I am looking for ideas or insights on how to handle big image files and work around the issues stated above.
Below is an excerpt from my local.conf for reference:
######################################
########### MENDER stuff #############
MENDER_ARTIFACT_NAME = "nx4.0"
INHERIT += "mender-full"
ARTIFACTIMG_FSTYPE = "ext4"
MENDER_STORAGE_DEVICE = "/dev/sdb"
MENDER_STORAGE_TOTAL_SIZE_MB = "915715"
#MENDER_STORAGE_TOTAL_SIZE_MB = "30000"
MENDER_DATA_PART_SIZE_MB = "1000"
IMAGE_ROOTFS_SIZE = "8192"
MENDER_FEATURES_DISABLE:append = " mender-systemd"
IMAGE_ROOTFS_MAXSIZE:forcevariable = "1024000000"