I have an embedded ZyboZ7 board running Yocto Zeus. It boots from a 4GB SDcard and I’m getting the following error from the mender-grow-data.service:
mender-client-resize-data-part[92]: Error: Can’t have overlapping partitions.
This systemd service calls:
/usr/bin/mender-client-resize-data-part
Which in turn tries to resize (grow) my ‘data’ partition (5):
/usr/sbin/parted -s /dev/mmcblk0 resizepart 5 100%
My Mender configuration adds an extra partition using the MENDER_EXTRA_PARTS mechanism. Here is my configuration:
# Mender Configuration
# The Mender storage device.
MENDER_STORAGE_DEVICE = "/dev/mmcblk0"
# Size of the memory device in MiB.
MENDER_STORAGE_TOTAL_SIZE_MB = "3700"
# Partition alignment
MENDER_PARTITION_ALIGNMENT = "4096"
MENDER_BOOT_PART_SIZE_MB = "16"
MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"
# An extra partition will result in the creation of an extended msdos
# partition in place of the primary partition typically used by the
# Mender 'data' partition. By default 'data' partition starts at "4" but it
# is now an extended partition. The "new" data partition will now
# shift to partition "5" and subsequent extra partitions will follow
# afterwards (e.g. "6", "7", ...).
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}5"
MENDER_DATA_PART_FSTAB_OPTS_append = ",sync"
# Extra partitions
MENDER_EXTRA_PARTS = "dante"
MENDER_EXTRA_PARTS[dante] = "--label=dante --fstype=ext4"
MENDER_EXTRA_PARTS_SIZES_MB[dante] = "4"
MENDER_EXTRA_PARTS_FSTAB[dante] = "auto defaults,sync"
MENDER_ARTIFACT_NAME = "${DISTRO}-2021-05-18"
MENDER_FEATURES_ENABLE_append = " mender-image mender-image-sd mender-client-install mender-uboot mender-systemd mender-growfs-data"
# This needs equal (2 * (BOOTENV_SIZE + (BOOTENV_SIZE % MENDER_PARTITION_ALIGNMENT)))
MENDER_RESERVED_SPACE_BOOTLOADER_DATA = "262144"
And my SDCard partitioning looks like the following:
# parted /dev/mmcblk0 unit s print
Model: SD SA04G (sd/mmc)
Disk /dev/mmcblk0: 7626752s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 520s 33287s 32768s primary fat16 boot, lba
2 33288s 3670271s 3636984s primary ext4
3 3670272s 7307255s 3636984s primary ext4
4 7307263s 7577607s 270345s extended lba
5 7307264s 7569407s 262144s logical ext4
6 7569416s 7577607s 8192s logical ext4
So basically, the data
and dante
partitions (5 & 6) are part of an extended msdos partition (4). The error occurs when parted
attempts to grow the data
partition but cannot because the dante
partition follows immediately after it. It seems this is the issue. Ideally I want the data
partition to follow the dante
partition (rather than vice-versa) so it could grow. Is there any way to configure Mender to place the data partition after the extra partitions so that it can grow automatically? Are extra partitions incompatible with auto growing the data
partition?