I have a 128 GB golden image, and do the initial mender-convert, which gives me the image in mender format. Everything is fine with the conversion, but the output
.img file is also 128 GB, which makes it slow to burn to SD and not so easy to copy, share, etc.
I experimented with the MENDER_COMPRESS_DISK_IMAGE setting, trying the gzip and lzma options, but that setting does not appear to affect the size of the generated
.img file, which is still 128 GB. I have also used PiShrink on the
.img after conversion, which works well for reducing its size. But PiShrink is not designed for Mender’s four partition layout, so at first boot expansion the empty disk space is assigned to the root partition. The pre-shrunk Mender image had a 102.5 GB
/data partition, and most all of it is lost to root.
Am I missing a setting in Mender that will shrink the initial
.img file, so that it will expand with correct partition sizes at first boot of the SD? If not, is there something like PiShrink that can handle the Mender partition layout? My workaround now with PiShrink is to use
parted to manually resize the
/data partition after first boot , then another reboot followed by running
resize2fs on the partition. It works, but is not acceptable as a long term solution.