coreos / fedora-coreos-tracker

Issue tracker for Fedora CoreOS
https://fedoraproject.org/coreos/
264 stars 59 forks source link

Persistent drive is always wiped, despite using the same Ignition config #1774

Closed RangHo closed 3 months ago

RangHo commented 3 months ago

Describe the bug

Even if I am using same hardware with same Ignition configuration, CoreOS always completely wipes and re-partitions the persistent /var partition.

Reproduction steps

  1. Build this configuration
  2. Use iPXE to chainload CoreOS

Expected behavior

Any changes I've made to /var, including adding new Podman volumes, should be persisted in the next boot.

Actual behavior

/var is always completely wiped, causing longer booting time and loss of data.

System details

Butane or Ignition config

# -*- mode: yaml -*-
variant: fcos
version: 1.5.0

ignition:
  config:
    merge:
      - source: https://by.rangho.dev/jumpstart/passwd/from-github?name=RangHo

storage:
  disks:
    - device: /dev/sda
      wipe_table: true
      partitions:
        - label: var
  filesystems:
    - device: /dev/disk/by-partlabel/var
      label: var
      format: ext4
      wipe_filesystem: true
      path: /var
      with_mount_unit: true
  files:
    # Set hostname
    - path: /etc/hostname
      mode: 0644
      contents:
        inline: RangHo-Barista

    # Enable mDNS support
    - path: /etc/systemd/resolved.conf
      contents:
        local: config/systemd-resolved.conf

    # CUPS daemon quadlet
    - path: /etc/containers/systemd/cupsd.container
      contents:
        local: quadlet/cupsd.container

    # Common bridge network for Internet-facing services
    - path: /etc/containers/systemd/webserver.network
      contents:
        local: quadlet/webserver.network

    # Caddy reverse proxy
    - path: /etc/caddy/Caddyfile
      contents:
        local: config/Caddyfile
    - path: /etc/containers/systemd/caddy.container
      contents:
        local: quadlet/caddy.container
    - path: /etc/containers/systemd/caddy-data.volume
      contents:
        local: quadlet/caddy-data.volume

    # Vaultwarden password manager quadlet
    - path: /etc/containers/systemd/vaultwarden.container
      contents:
        local: quadlet/vaultwarden.container
    - path: /etc/containers/systemd/vaultwarden-data.volume
      contents:
        local: quadlet/vaultwarden-data.volume

The latest version of what I'm testing with can be found [HERE](https://github.com/RangHo/infrastructure/blob/main/barista/main.bu).

Additional information

This was never an issue when I was booting straight from iPXE EFI executable, using a $3 USB stick stuck to the machine. I just set up an OpenWrt router that is capable of acting as a PXE server, so I swapped from EFI executable to PXE binary. Now, I cannot use the persistent storage anymore.

Nemric commented 3 months ago

Hi, You did write in your config wipe_filesystem: true and you should set it to false perhaps you should not use wipe_table: true to :/ you can read https://docs.fedoraproject.org/en-US/fedora-coreos/live-booting/#_using_persistent_state

RangHo commented 3 months ago

Oh, apparently I misunderstood the Ignition reference manual I guess. I thought wipe_filesystem suppresses boot failure when filesystem signagures don't match, which is what wipe_table does if I understood correctly.

Thanks for pointing that out! Closing.