Systemd-growfs resize to 128M only

Hi,

I’m using systemd-growfs feature to grow data to end of SDcard. I’m on warrior branch but only define:

MENDER_DATA_PART_FSTAB_OPTS_append = ",x-systemd.growfs"

and it looks like service is started but report only this:

Sep 23 18:47:19 a33-som-m80 systemd[1]: Starting Grow File System on /data...
Sep 23 18:47:19 a33-som-m80 systemd-growfs[230]: Successfully resized "/data" to 128.0M bytes (131072 blocks of 1024 bytes).
Sep 23 18:47:19 a33-som-m80 systemd[1]: Started Grow File System on /data.

I didn’t change data partition size. It’s even weird that fdisk report that card have 15G but for some reason growfs code check only size of partition. Am I missing something here? Define data part size to 10G or so? Confused :confused:

Thanks

You should add,

MENDER_FEATURES_ENABLE_append = "mender-growfs-data"

Otherwise you will not get this, which will resize the underlying block device before resizing the filesystem image.

2 Likes

@mirzak thanks I see it now. Was looking down to thread here where it was discussed I had feeling nothing else is necessary (adding extra systemd script) but didn’t read till end. I realized I’m on thud not warrior so need to work on it other way. Thanks for pointers.

Hey, Marek, maybe you found a suitable solution for a pre-242 systemd to grow data partition and fs on initial boot?

Hi @mkozjak, it is possible to create a manual systemd script, similar to what is done here, and use parted to resize your partition on boot.

1 Like

Additionally in the simplest form (without relying on the systemd growfs feature) you can run:

# Resizes partition
parted --script /dev/mmcblk0 resizepart 4 100%

# Resizes filesystem
resize2fs /dev/mmcblk0p4

So it is a matter of putting something similar to above in a script that runs on boot.

1 Like

Thank you so much, guys!