How to specify size of root partition in ignition file


Situation: I have a VM with one big hard disk. I want to install Fedora CoreOS on it and the root partition should occupy 24GB of the disk space. The remaining disk space is left empty or otherwise partitioned for volumes.

I haven’t found out how to achieve this with an ignition file. I tried different approaches, and the closest to what I want, and that works, is this:

variant: fcos
version: 1.0.0
    - device: /dev/sda
        - number: 0
          label: test1
          size_mib: 24576
          start_mib: 0
        - number: 0
          label: test2
          size_mib: 49152
          start_mib: 0

which creates, in addition to the 4 system partitions two more with labels test1, test2 and size 24GB, 48GB. But the root partition is set to an arbitrary size of only 2.2GB, and this is too small.

All my other attempts to specify the size of the root partition have failed. Is this possible at all, and how?

Thanks in advance

It’s possible via a trick: set the start_mib of the first data partition to 25089. That allows 1 MiB for the partition table, 384 for /boot, 127 for /boot/efi, and 1 for the BIOS boot partition, leaving exactly 24 GiB for /. After Ignition runs, the root partition will be resized to fit in the space up to the next partition.

We should document this.

That works, thank you :slightly_smiling_face:

Yes, it should be documented. And that the root partition layout cannot be changed with the storage specification outlined here should also be documented.

Could you please help me to show your example fcc file? I don’t quite understand how this trick work.

Its like the FCC file above, just with start_mib: 25089 for the “test1” partition, instead of start_mib: 0. The test2 partition could be left out, its not important.

I failed with the same ignition file last time but succed today. Thanks for your help.

1 Like