Questions about FCOS Ignition partitioning

Hi,

I am new to FCOS and Butane/Ignition.

I am looking to make a Butane file that wipes the entire disk and recreates the required partitions. I first tried:

variant: fcos
version: 1.6.0
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - XXX
      password_hash: XXX
storage:
  disks:
    - device: /dev/disk/by-id/coreos-boot-disk
      wipe_table: true
      partitions:
        - label: root
          number: 4
          size_mib: 8192
          resize: true
        - label: swap
          number: 5
          size_mib: 1024
          resize: true
        - label: var
          number: 6
          size_mib: 0
          resize: true
  filesystems:
    - device: /dev/disk/by-partlabel/root
      label: root
      format: xfs
      wipe_filesystem: true
    - device: /dev/disk/by-partlabel/swap
      label: swap
      format: swap
      with_mount_unit: true
      wipe_filesystem: true
    - device: /dev/disk/by-partlabel/var
      label: var
      path: /var
      format: btrfs
      with_mount_unit: true
      wipe_filesystem: true

This example comes directly from Configuring Storage :: Fedora Docs and Configuring Storage :: Fedora Docs

With this setup, I get the following error:
Error: System has 0 devices with a filesystem labeled ‘boot’:

And, indeed, if I look at the partitions with lsblk, there is only the partitions I have manually set up in that butane file, so not boot partition.

I could not find a definitive answer to this question:

If I define my own partitions, does FCOS still creates the default partitions, aka:

?

I have found examples of people using wipe_table: true, but none of them were manually defininge BIOS-BOOT, EFI-SYSTEM, boot… partitions. The official documentation is not doing it either.

Then, if manually defining these partitions too is required if I want to add my own, what should be the correct way of defining them ?

I have been trying for hours now to find the correct declaration for BIOS-BOOT, EFI-SYSTEM and boot, but I could not find a working configuration. My current (non working) configuration is:

variant: fcos
version: 1.6.0
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - XXX
      password_hash: XXX
storage:
  disks:
    - device: /dev/disk/by-id/coreos-boot-disk
      wipe_table: true
      partitions:
        - label: BIOS-BOOT
          number: 1
          size_mib: 1
          resize: true
        - number: 2
          size_mib: 384
          resize: true
        - label: boot
          number: 3
          size_mib: 384
          resize: true
        - label: root
          number: 4
          size_mib: 8192
          resize: true
        - label: swap
          number: 5
          size_mib: 1024
          resize: true
        - label: var
          number: 6
          size_mib: 0
          resize: true
  filesystems:
    - device: /dev/disk/by-label/EFI-SYSTEM
      path: /boot/efi
      format: vfat
      wipe_filesystem: true
    - device: /dev/disk/by-partlabel/boot
      label: boot
      path: /boot
      format: xfs
      wipe_filesystem: true
    - device: /dev/disk/by-partlabel/root
      label: root
      format: xfs
      wipe_filesystem: true
    - device: /dev/disk/by-partlabel/swap
      label: swap
      format: swap
      with_mount_unit: true
      wipe_filesystem: true
    - device: /dev/disk/by-partlabel/var
      label: var
      path: /var
      format: btrfs
      with_mount_unit: true
      wipe_filesystem: true

This fails with the following rdsosreport.txt : https://paste.hostux.net/?5a6b4d005bcf3356#HpXceNjeTMsW5ZZyduWRZWT7Vvco5GTn2Ln7bmHH3aMy

Could you please help me to find the correct partitioning ? Is there a way to tell FCOS to apply the default partitioning, after the table has been wiped ?

Thanks in advance for your help

The swap partition example you referenced uses a separate disk. I have not personally tried adding a swap partition in Fedora CoreOS. Can you try omitting the swap partition from your first configuration and see if Ignition succeeds?

Thanks for your answer.

I will try without swap asap. But do you know if FCOS is supposed to create the default partitions even if I define custom additional partitions ? The documentation is not very clear about that, and it would help me a lot to know if I should define the default partitions myself or not. It would help me to know if I should iterate on the first example I showed, or the second.

If I can let FCOS creates the default partitions and just add mine, it would make it much simpler and avoid a lot of mistakes (first example). But I want to keep wiping the table to start from a clean state every time.

Ignition will create all the necessary partitions, so you don’t need to declare them explicitly. You just have to use your first configuration and add only the additional partitions or disks. You usually don’t need to wipe the table and start over every time you provision a new node.

Thanks for your answer.

I would like to use wipe_table: true because I would like to have a butane file that I can deploy even if the disk was previously used on another OS, so wiping table assures me that I start from a clean state. I could of course install coreos without my butane file, let it create the default partitions, and then re-install with the butane file to set the additional partitions I want, but I would like to do it all in one install.

I just tried with

variant: fcos
version: 1.6.0
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - XXX
      password_hash: XXX
storage:
  disks:
    - device: /dev/disk/by-id/coreos-boot-disk
      wipe_table: true
      partitions:
        - label: root
          number: 4
          size_mib: 8192
          resize: true
        - label: var
          size_mib: 0
          resize: true
  filesystems:
    - device: /dev/disk/by-partlabel/root
      label: root
      format: xfs
      wipe_filesystem: true
    - device: /dev/disk/by-partlabel/var
      label: var
      path: /var
      format: btrfs
      with_mount_unit: true
      wipe_filesystem: true
  

It did install and boot correctly. The resulting table is:

nvme0n1
├─nvme0n1p1
├─nvme0n1p2 vfat    FAT16                                          A996-FAD5
├─nvme0n1p3 xfs                      boot                          ace82da2-4c54-4db7-ba77-704ae30e347b  147.5M    54% /boot
├─nvme0n1p4 xfs                      root                          4b562813-63e8-4410-8684-139872f370ba    6.1G    23% /sysroot/ostree/deploy/fedora-coreos/var
│                                                                                                                      /sysroot
│                                                                                                                      /etc
├─nvme0n1p5 swap    1                swap                          5484882d-c00f-4051-a775-a419bbcb0f32                [SWAP]
└─nvme0n1p6 btrfs                    var                           2ce63c95-c308-41fc-b689-d8d160b452ac  226.7G     0% /var

The default partitions got indeed created, so I can iterate on the first example. But it does not match the documentation, is that normal ?

A swap partition is created (which is great, I don’t have to do it manually), and boot is xfs and not ext4.

Yes, we probably need to update the docs.

I’m not entirely sure why /boot is xfs and not ext4, but that shouldn’t be a issue.

Ok, thanks a lot for your answer!

Talking about the documentation, I can’t find in the docs if it is possible to use both storage.disks and storage.luks. Both in the docs and on discourse here, I couldn’t find example using both in the same Butane. I am stuck trying to use them both, so I am wondering if it is possible. But that is a different problem so I made a separate post Can't combine manual partitioning + LUKS

Have a nice day