Re: [WIC] Grow last partition up to disk size


Mike Looijmans
 

On 30-04-2020 20:23, Khem Raj via lists.yoctoproject.org wrote:


On 4/30/20 11:16 AM, Marek Belisko wrote:
Hi Rudolf,

On Thu, Apr 30, 2020 at 7:39 PM Rudolf J Streif
<rudolf.streif@...> wrote:

I was looking for a way in a wks file to have wic grow the last
partition to fill up the remainder of the disk. Of course wic does not
know how large the disk is but that could be a parameter.

The alternative way is to use fixed-size and do the math manually but
that would not allow wic to grow a partition based on content.
You can use https://manpages.debian.org/testing/systemd/systemd-growfs.8.en.html
which grow partition to the end.
can it grow a mounted partition ? since that will be the case when growing rootfs partition.

Yes, a mounted ext4 partition can be resized. Some tools will try to keep you from doing that though, had to patch parted to stop whining about mounted partitions in "scripted" mode that to make it work though.

https://github.com/topic-embedded-products/topic-platform/tree/zeus/meta-topic-platform/recipes-extended/parted

Here's the recipe that re-partitions the SD or eMMC on first boot after programming a (small) wic image:

https://github.com/topic-embedded-products/topic-platform/tree/zeus/meta-topic-platform/recipes-topic/expand-wic-partition

Join yocto@lists.yoctoproject.org to automatically receive all group messages.