Device order ignition config, flatcar-container-linux

134 views Asked by At

Trying to add multiple disks using ignition config

  • First disk has 50 GB and need to be wiped(root)
  • Second disk has 10 GB and need not to be wiped(persistent)

Here is my ignition config, how will I make sure on boot the 50GB is mapped to /dev/sda and 10GB is mapped to /dev/sdb and it does not swap during a reboot

storage:
   disks:
     - device: /dev/sda
       partitions:
          - label: "root"
       wipe_table: true
     - device: /dev/sdb
         partitions:
          - label: "data"
       wipe_table: false
filesystems:
   - name: root
     mount:
       device: /dev/disk/by-partlabel/root
       format: ext4
       label: root
       wipe_filesystem: true
   - name: data
     mount:
       device: /dev/disk/by-partlabel/data
       format: ext4
       label: data
       wipe_filesystem: false
1

There are 1 answers

0
kaeso On

Overall those names depend on how the kernel discovered and enumerated the devices, which in turn depends on how the firmware of machine exposes them to the kernel (and how stably/deterministically).

If you firmware exposes them in a reliably consistent way to the kernel, then sda and sdb names should stay the same even across reboots.

If for some reason on your specific machine the disks may get enumerated in different order across reboots, then you may consider using stable identifiers to identify them (instead of the ephemeral names).

For example, you can reference them by hardware-level path (under /dev/disk/by-path/) or by their hardware ID (under /dev/disk/by-id/). On a running Linux machine, you can discover those extra identifier via udevadm info /dev/<YOUR_DISK>.