Bug 1916382 - Can't create ext4 filesystems with Ignition
Summary: Can't create ext4 filesystems with Ignition
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RHCOS
Version: 4.6.z
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.7.0
Assignee: Benjamin Gilbert
QA Contact: Michael Nguyen
URL:
Whiteboard:
Depends On:
Blocks: 1915617
TreeView+ depends on / blocked
 
Reported: 2021-01-14 16:43 UTC by Benjamin Gilbert
Modified: 2021-02-24 15:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: mkfs.ext4 fails when /etc/mke2fs.conf does not exist. Consequence: Ignition cannot create ext4 filesystems. Fix: Add /etc/mke2fs.conf to the initramfs. Result: Ignition successfully creates ext4 filesystems.
Clone Of:
Environment:
Last Closed: 2021-02-24 15:53:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift os pull 485 0 None closed 05rhcos: add /etc/mke2fs.conf to the initrd to fix mkfs.ext4 2021-02-10 22:15:02 UTC
Red Hat Bugzilla 1889464 0 unspecified CLOSED CSI driver: Could not create file system on attached volume directory 2023-09-15 00:49:52 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:53:39 UTC

Description Benjamin Gilbert 2021-01-14 16:43:10 UTC
Description of problem:
Ignition fails when creating an ext4 filesystem.

Version-Release number of selected component (if applicable):
ignition-2.9.0-1.rhaos4.7.git1d56dc8.el8.x86_64
(Also happens on 4.6.)

How reproducible:
Always

Steps to Reproduce:
1. Boot with this Ignition config:

{
  "ignition": {
    "version": "3.1.0"
  },
  "storage": {
    "filesystems": [
      {
        "device": "/dev/disk/by-partlabel/root",
        "format": "ext4",
        "label": "root",
        "wipeFilesystem": true
      }
    ]
  }
}

Actual results:
Jan 14 16:18:37 localhost systemd[1]: Starting Ignition (disks)...
Jan 14 16:18:37 localhost ignition[768]: Ignition 2.9.0
Jan 14 16:18:37 localhost ignition[768]: Stage: disks
[...]
Jan 14 16:18:37 localhost ignition[768]: disks: createFilesystems: op(4): [started]  creating "ext4" filesystem on "/run/ignition/dev_aliases/dev/disk/by-partlabel/root"
Jan 14 16:18:37 localhost ignition[768]: disks: createFilesystems: op(4): executing: "mkfs.ext4" "-F" "-L" "root" "/run/ignition/dev_aliases/dev/disk/by-partlabel/root"
Jan 14 16:18:37 localhost ignition[768]: disks: createFilesystems: op(4): [failed]   creating "ext4" filesystem on "/run/ignition/dev_aliases/dev/disk/by-partlabel/root": exit status 1: Cmd: "mkfs.ext4" "-F" "-L" "root" "/run/ignition/dev_aliases/dev/disk/by-partlabel/root" Stdout: "" Stderr: "Syntax error in mke2fs config file (<default>, line #22)\n\tUnknown code prof 17\n"
Jan 14 16:18:37 localhost ignition[768]: disks failedFull config:
[...]
Jan 14 16:18:37 localhost ignition[768]: Ignition failed: failed to create filesystems: mkfs failed: exit status 1: Cmd: "mkfs.ext4" "-F" "-L" "root" "/run/ignition/dev_aliases/dev/disk/by-partlabel/root" Stdout: "" Stderr: "Syntax error in mke2fs config file (<default>, line #22)\n\tUnknown code prof 17\n"
Jan 14 16:18:37 localhost systemd[1]: ignition-disks.service: Main process exited, code=exited, status=1/FAILURE
Jan 14 16:18:37 localhost systemd[1]: ignition-disks.service: Failed with result 'exit-code'.
Jan 14 16:18:37 localhost systemd[1]: Failed to start Ignition (disks).

Expected results:
Boot succeeds.

Additional info:
Ignition configs enabling root RAID are affected.  Bug 1889464 is the underlying issue, and the workaround is to ship /etc/mke2fs.conf in the initrd.

Comment 2 Michael Nguyen 2021-01-20 18:40:24 UTC
Verified on RHCOS 47.83.202101161239-0  which is part of registry.ci.openshift.org/ocp/release:4.7.0-0.nightly-2021-01-16-201946


cat << EOF > ignition.yaml
{
  "ignition": {
    "version": "3.1.0"
  },
  "storage": {
    "filesystems": [
      {
        "device": "/dev/disk/by-partlabel/root",
        "format": "ext4",
        "label": "root",
        "wipeFilesystem": true
      }
    ]
  }
}
EOF

Start RHCOS with the ignition file.

[core@localhost ~]$ rpm-ostree status
State: idle
Deployments:
● ostree://8e87a86b9444784ab29e7917fa82e00d5e356f18b19449946b687ee8dc27c51a
                   Version: 47.83.202101161239-0 (2021-01-16T12:43:01Z)
[core@localhost ~]$ df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  945M     0  945M   0% /dev
tmpfs          tmpfs     989M   84K  989M   1% /dev/shm
tmpfs          tmpfs     989M  540K  988M   1% /run
tmpfs          tmpfs     989M     0  989M   0% /sys/fs/cgroup
/dev/vda4      ext4       16G  2.3G   13G  16% /sysroot
tmpfs          tmpfs     989M     0  989M   0% /tmp
/dev/vda3      ext4      364M   97M  244M  29% /boot
tmpfs          tmpfs     198M  8.0K  198M   1% /run/user/1000

Comment 5 errata-xmlrpc 2021-02-24 15:53:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633


Note You need to log in before you can comment on or make changes to this bug.