MicroOS provisioning via Ignition fails due to a read-only file system when attempting to mount a volume in the /var

I’m trying to set up a MicroOS server using Ignition and Combustion.

The environment is configured in Hyper-V, where the virtual machine boots directly from the VHDX image downloaded from the web. An attached ISO contains the Ignition and Combustion configuration.

My goal is to format and mount a secondary disk attached to the VM using Ignition.

Here’s the relevant configuration

  disks:
    - device: /dev/sdb
      wipe_table: true
      partitions:
      - size_mib: 0
        start_mib: 0
        label: data
  
  filesystems:
    - path: /var/mnt/data
      device: /dev/disk/by-partlabel/data
      format: btrfs
      with_mount_unit: true

However, provisioning fails because /sysroot/var/mnt appears to be read-only.

What’s puzzling is that I can create files and directories in /var using the same Ignition setup.

My question is: If mounting under /var/mnt is not possible during Ignition, where should I mount my drive/partition instead? Or what is the correct syntax?

@unlikely Hi, since it’s btrfs you would mount as a sub volume. Perhaps a read here https://rootco.de/2018-01-19-opensuse-btrfs-subvolumes/ and https://en.opensuse.org/SDB:BTRFS may help in your Ignition json.

Thank you for your response and for the links that provided some useful context and an overview.

That said, I feel I could use more practical advice.

After provisioning with ignition-combustion, without mounting the second disk, I’m able to manually create the directory under /var/mnt and mount there the second disk. But in ignition this seems impossible.

Using a subvolume is needed or recommmended?

On a related note, I’m considering moving the entire /var directory to the second virtual disk, as the first one doesn’t have much space.

Do you have any guidance for this as well?

After provisioning with ignition-combustion, without mounting the second disk, I’m able to manually create the directory under /var/mnt and mount there the second disk. But in ignition this seems impossible.

Using a subvolume is needed or recommmended?

I also struggle at exactly this point. But at least I found a way to mount one additional HDD to the pre-defined directory /opt:

  disks:
    # additional HDD
    - device: "/dev/disk/by-id/wwn-0x50014ee21264eceb"
      wipe_table: true
      partitions:
        - number: 1
          size_mib: 0
          label: opt
  filesystems:
    # SSD
    - path: /home
      device: "/dev/disk/by-id/wwn-0x5002538d40db1ab0-part3"
      format: btrfs
      wipe_filesystem: false
      with_mount_unit: true
      mount_options:
        - "subvol=/@/home"
    # additional HDD
    - path: /opt
      device: "/dev/disk/by-partlabel/opt"
      format: btrfs
      wipe_filesystem: true
      with_mount_unit: true

But when trying to mount that HDD to /mnt/4t I’m getting the error:

Ignition failed: mkdir /sysroot/mnt/4t: read-only file system

Example:

  disks:
    # additional HDD
    - device: "/dev/disk/by-id/wwn-0x50014ee21264eceb"
      wipe_table: true
      partitions:
        - number: 1
          size_mib: 0
          label: 4t
  filesystems:
    # SSD
    - path: /home
      device: "/dev/disk/by-id/wwn-0x5002538d40db1ab0-part3"
      format: btrfs
      wipe_filesystem: false
      with_mount_unit: true
      mount_options:
        - "subvol=/@/home"
    # additional HDD
    - path: /mnt/4t
      device: "/dev/disk/by-partlabel/4t"
      format: btrfs
      wipe_filesystem: true
      with_mount_unit: true

I also can’t find examples for different directories than /opt - is everybody only using /opt? :joy: