first time FCOS user here. I’m currently trying to compile an ignition file for a test bare metal machine that is supposed to become my home server once it is all in place.
But it fails when setting up the raid.
Excerpt from my config:
[ 8.639138] localhost ignition[1085]: disks: createRaids: created device alias for "/dev/sdb": "/run/ignition/dev_aliases/dev/sdb" -> "/dev/sdb"
[ 8.639154] localhost ignition[1085]: disks: createRaids: created device alias for "/dev/sdc": "/run/ignition/dev_aliases/dev/sdc" -> "/dev/sdc"
[ 8.639168] localhost ignition[1085]: disks: createRaids: created device alias for "/dev/sdd": "/run/ignition/dev_aliases/dev/sdd" -> "/dev/sdd"
[ 8.639182] localhost ignition[1085]: disks: createRaids: created device alias for "/dev/sde": "/run/ignition/dev_aliases/dev/sde" -> "/dev/sde"
[ 8.639201] localhost ignition[1085]: disks: createRaids: op(13): [started] creating "jbod"
[ 8.639211] localhost ignition[1085]: disks: createRaids: op(13): executing: "mdadm" "--create" "jbod" "--force" "--run" "--homehost" "any" "--level" "linear" "--raid-devices" "4" "/run/ignition/dev_aliases/dev/sdb" "/run/ignition/dev_aliases/dev/sdc" "/run/ignition/dev_aliases/dev/sdd" "/run/ignition/dev_aliases/dev/sde"
[ 8.652823] localhost 55-scsi-sg3_id.rules[1485]: WARNING: SCSI device md127 has no device ID, consider changing .SCSI_ID_SERIAL_SRC in 00-scsi-sg3_config.rules
[ 8.789042] localhost systemd-journald[371]: Missed 83 kernel messages
[ 8.789042] localhost kernel: md: personality for level -1 is not loaded!
[ 8.790014] localhost kernel: md: md127 stopped.
[ 8.828408] localhost ignition[1085]: disks: createRaids: op(13): [failed] creating "jbod": exit status 1: Cmd: "mdadm" "--create" "jbod" "--force" "--run" "--homehost" "any" "--level" "linear" "--raid-devices" "4" "/run/ignition/dev_aliases/dev/sdb" "/run/ignition/dev_aliases/dev/sdc" "/run/ignition/dev_aliases/dev/sdd" "/run/ignition/dev_aliases/dev/sde" Stdout: "mdadm: Defaulting to version 1.2 metadata\n" Stderr: "mdadm: RUN_ARRAY failed: Invalid argument\n"
[ 8.829732] localhost ignition[1085]: disks failed
It looks like a kernel module for my selected raid level is missing.
I tried to add different systemd units to work around this (e.g. using “add_drivers+=linear” in some dracut config file or running modprobe in a oneshot unit) but nothing worked or had any impact on the result in rdsosreport.txt.
As far as I can see, you want to make a RAID array of /dev/sdb, /dev/sdc, /dev/sdd and /dev/sde, but not /dev/sda which is the boot device, and set up the array as a separate /var mount. Is this correct?
Digging into this I found that some md personalities are deprecated from the upstream Kernel, see md: mark some personalities as deprecated · torvalds/linux@608f52e · GitHub. Perhaps we should consider removing the explicit mention of the linear array redundancy level from the Butane and Ignition docs.
Not sure if it would be suitable for your use case, but here is a simplified Butane config for RAID 0 level that you can use as a reference.
Butane config file
variant: fcos
version: 1.6.0
# Authentication
passwd:
users:
- name: core
ssh_authorized_keys: [ssh-ed25519 AAAA...]
storage:
disks:
# The link to the block device the OS was booted from.
- device: /dev/disk/by-id/coreos-boot-disk
# We do not want to wipe the partition table since this is the primary device.
wipe_table: false
partitions:
- number: 4
label: root
# Allocate at least 8 GiB to the rootfs. See NOTE above about this.
size_mib: 8192
resize: true
# This defines two partitions, each on its own disk.
- device: /dev/vdb
wipe_table: true
partitions:
# Each partition gets a human-readable label.
- label: "raid-linear-1"
# Each partition is placed at the beginning of the disk.
number: 1
size_mib: 0
start_mib: 0
- device: /dev/vdc
wipe_table: true
partitions:
- label: "raid-linear-2"
number: 1
size_mib: 0
start_mib: 0
directories:
- path: /var/data
# We use the previously defined partitions as devices in a Linear RAID md array.
raid:
- name: md-data
level: raid0
devices:
- /dev/disk/by-partlabel/raid-linear-1
- /dev/disk/by-partlabel/raid-linear-2
# Configuring the filesystems.
filesystems:
# Changing the root filesystem to ext4.
- device: /dev/disk/by-partlabel/root
wipe_filesystem: true
format: ext4
label: root
# The resulting md array is used to create an ext4 filesystem.
- device: /dev/md/md-data
path: /var/data
label: DATA
format: ext4
with_mount_unit: true
Thanks a lot for digging into this.
Your example with raid0 instead of linear works fine for me. I will stick to raid0 for now and first finish the rest of my config before checking how I could use device mapper to get the same behavior as “linear”.