Not sure how the partition sizes are determined. I have an 8GB SD Card from which a mender image is created using mender-convert. However after this is done I have NO space available in /dev/root. It indicates 2GB in size and almost 100% full. My applications start to fail because there is NO room.
How can I make sure there is more space available on /dev/root?
I use Debian family and not Yocto Project. I can see that there are variables to use to set sizes but not sure exactly how this works. I assumed it would automatically set the sizes based on the total size of the sd card image.
Hi @ryanbedford. You need to adjust MENDER_STORAGE_TOTAL_SIZE_MB, MENDER_DATA_PART_SIZE_MB and MENDER_BOOT_PART_SIZE_MB. The size of the rootfs is calculated from those values.
I’ve pasted my log entries for the convert. I made the adjustments to various sizes. I bolded the interesting areas.
When all is said and done, I do NOT get the size available in the rootfs. I only have the 1934 (listed in bold) and I only have 20 or 30 meg left! That is not good for log file growth, and soon everything stops.
Even though it reports 3700 MiB x2 further down for RootFS, I don’t get that size. So my current problem is how to get that usable space back.
2020-06-19 14:28:44 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2020-06-19 14:28:44 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi0w_config
2020-06-19 14:28:44 [INFO] [mender-convert-extract] Validating disk image
2020-06-19 14:28:44 [INFO] [mender-convert-extract] Disk parsed successfully
2020-06-19 14:28:44 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos
2020-06-19 14:28:44 [INFO] [mender-convert-extract] PART 1: SIZE: 256M TYPE: 0xc
2020-06-19 14:28:44 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs
2020-06-19 14:28:53 [INFO] [mender-convert-extract] PART 2: SIZE: 7.1G TYPE: 0x83
2020-06-19 14:28:53 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs
Running mender-convert-modify: --disk-image input/golden-temp-v3.img --config configs/raspberrypi0w_config --overlay rootfs_overlay_demo/
2020-06-19 14:37:05 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2020-06-19 14:37:05 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi0w_config
2020-06-19 14:37:33 [INFO] [mender-convert-modify] Installing Mender client and related files
2020-06-19 14:37:34 [INFO] [mender-convert-modify] Installing a custom /etc/fstab (see work/convert.log for more info)
2020-06-19 14:37:34 [INFO] [mender-convert-modify] Performing platform specific modifications (if any)
2020-06-19 14:37:34 [INFO] [mender-convert-modify] Running hook: platform_modify
2020-06-19 14:37:34 [INFO] [mender-convert-modify] Performing user/local specific modifications (if any)
2020-06-19 14:37:34 [INFO] [mender-convert-modify] Running hook: user_local_modify
2020-06-19 14:37:34 [INFO] [mender-convert-modify] Applying rootfs overlay: rootfs_overlay_demo/
mender-convert-modify has finished. Cleaning up…
Running mender-convert-package: --disk-image input/golden-temp-v3.img --config configs/raspberrypi0w_config --overlay rootfs_overlay_demo/
2020-06-19 14:37:39 [INFO] [mender-convert-package] Using configuration file: configs/mender_convert_config
2020-06-19 14:37:39 [INFO] [mender-convert-package] Using configuration file: configs/raspberrypi0w_config 2020-06-19 14:37:40 [INFO] [mender-convert-package] Rootfs filesystem size will be 1934 MiB
2020-06-19 14:37:40 [INFO] [mender-convert-package] Creating a file-system image from: work/rootfs/data/
2020-06-19 14:37:41 [INFO] [mender-convert-package] Creating a file-system image from: work/rootfs/
2020-06-19 14:39:55 [INFO] [mender-convert-package] Copying root filesystem image to deploy directory
2020-06-19 14:40:42 [INFO] [mender-convert-package] Writing Mender artifact to: deploy/golden-temp-v3-raspberrypi0w-mender.mender
2020-06-19 14:40:42 [INFO] [mender-convert-package] This can take up to 20 minutes depending on which compression method is used
2020-06-19 14:42:48 [INFO] [mender-convert-package] Creating Mender compatible disk-image 2020-06-19 14:42:49 [INFO] [mender-convert-package] Total disk size: 8192 MiB 2020-06-19 14:42:49 [INFO] [mender-convert-package] Boot partition 256 MiB 2020-06-19 14:42:49 [INFO] [mender-convert-package] RootFS partitions 3700 MiB x 2 2020-06-19 14:42:49 [INFO] [mender-convert-package] Data partition 512 MiB
2020-06-19 14:44:58 [INFO] [mender-convert-package] Performing platform specific package operations (if any)
2020-06-19 14:44:58 [INFO] [mender-convert-package] Running hook: platform_package
2020-06-19 14:44:58 [INFO] [mender-convert-package] Compressing deploy/golden-temp-v3-raspberrypi0w-mender.img.gz
2020-06-19 14:50:00 [INFO] [mender-convert-package] Conversion has completed!
Which file did you modify to change the settings? My best guess is that it is processing the config file with your changes first and then overwriting that with the settings in the other config file.
Drew
I updated the settings in the mender_convert_config. The MENDER_STORAGE_TOTAL_SIZE_MB was already correct at 8192 (that is how big my SD card is image is, so no change needed). I increased MENDER_BOOT_PART_SIZE_MB to 256 (to get rid of warning that 40MB was too small). Then I made the MENDER_DATA_PART_SIZE_MB to 512.
That is the only file I modified. Is there another file?
Yep, just figured that out. This is not at all obvious. This space should be given without having to dig for these parameters. I could have had a fleet of devices deployed and only would have found out when log files grew and started crashing systems, left and right.
It even says the size it’s going to use for each partition (3700) and won’t do it. And using the -1 setting didn’t make a difference either. Had to specify exactly what size I wanted, if I want ANY extra space.
This is primarily done as an speed optimization as the Artifacts tend to get big in these type of systems. The root filesystem size is what the Mender client will write when you perform an update (2,8GB vs 4GB in my setup).
Generally the root filesystem should be treated as a stateless part, and in that case free space should not matter much as long it is enough to boot up.
But sure, this can probably be documented better or better prints.
I am also not sure how much this optimization helps nowadays, as the Mender client has gotten “better” in how it writes data, so maybe we should investigate changing the default as well.
Thank you @mirzak for the explanations. I did see all those sizes which is why I posted them and bolded them. Was just hung up on rootfs size. Now that is resolved and working great.
I did in fact move my applications log files to the /data directory, which makes way more sense. But the danger was still there as the normal system log files would have eventually filled the small amount of remaining space available.