I’m trying to create a mender image from raspbian for the raspberry 3.
As I understand, 4 files are concerned by the process:
mender_convert_config
raspberrypi_config
raspberrypi3_config
raspberrypi3_raspbian_config
In each of these files (where possible) I set the “IMAGE_ROOTFS_SIZE” to 8192MB.
However, when I create my image, mender-convert will always fill all the sd card size and won’t respect my specific resizing. Thus, my RootFS size are bigger than expected.
The RootFS should not change size once the device boots, but the last partition (which is mounted at /data) might get expanded to occupy the full disk.
This is the output from fdisk on the device using the created image (checked same from img file):
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 24576 548863 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 548864 32767999 32219136 15.4G 83 Linux
/dev/mmcblk0p3 32768000 64987135 32219136 15.4G 83 Linux
/dev/mmcblk0p4 64987136 67084287 2097152 1G 83 Linux
As I understood : MENDER_STORAGE_TOTAL_SIZE_MB is used to define the size of the SD Card in total. I defined this to 32768 as my SD Card is a 32GB.
Also what do you mean by filesystem image size ? How does it relate to the partition size ?
MENDER_DATA_PART_GROWFS=y; this part is clear, I setted it to n so the data partition won’t grow up. The problem is that my partitions are already sized badly upon the generation of the image and not on the boot of it.
The output of mender-convert shows :
2020-04-01 14:42:26 [INFO] [mender-convert-package] Total disk size: 32768 MiB
2020-04-01 14:42:26 [INFO] [mender-convert-package] Boot partition 256 MiB
2020-04-01 14:42:26 [INFO] [mender-convert-package] RootFS partitions 15732 MiB x 2
2020-04-01 14:42:26 [INFO] [mender-convert-package] Data partition 1024 MiB
Even though I configured the RootFS to be 8GB in size.
Is it possible to fix the RootFS size to 8192 MB (8GB) ?
It does not (or well, the rootfs image will go in to the partition in the ned), and that is why IMAGE_ROOTFS_SIZE does not impact partition sizes and only impacts the rootfs image size.
See separate response regarding partition sizes and how rootfs partition size is calculated.