How to trigger expand on root partition?

For CoreOS CL:

On first boot, the ROOT partition and filesystem will expand to fill any remaining free space at the end of the drive.

How do I trigger this on FCOS? I have expanded the disk for the ova to 100GB, but my root partition remains at the original size. I can expand the partition manually using growpart and xfs_growfs, but is there a way to trigger a resize via FCOS or ignition?

This is true for Fedora CoreOS as well. The root partition should get expanded on first boot. This is done by the ignition-ostree-growfs.service.

Is it not running on boot for you? What does the journal show?

journalctl -u ignition-ostree-growfs.service

Also, are you resizing the disk after you’ve booted the machine?

My build procedure runs packer to create a new image and then expand the disk. Doing it in this order creates a smaller image. With CL, that first boot after creating the new image expanded the disk. With FCOS, it does not.

I’m not sure why CL worked given that technically it was the second boot of that image where /sysroot got expanded due to packer being the first boot. We were using Cloud Config, so perhaps it was something due to how that worked. I can see FCOS running the ignition-ostree-growfs.service in the logs during the packer boot. So it is working… just differently than CL.

Nevertheless, is there a way I can trigger FCOS to resize the disk or do I need to make my own oneshot service to do this check?

Thank you for all your help!

In FCOS it only runs on first boot, just like ignition. I guess the growpart bits that ran in CL ran on every boot and not just the first boot? We probably need to evaluate this whole packer workflow in the future to see how we can either support that better or provide users with a better way to do what they’re doing with packer.

Regarding growing the FS you can can probably just run growpart and xfs_growfs just like coreos-growpart does, but you’ll probably have to experiment a bit.