Repository navigation
Description
Bug
ostree system with LUKS fails to boot after a systemctl soft-reboot
Adding x-initrd.attach to crypttab when provisioning LUKS on ostree systems would fix the issue.
Operating System Version
Fedora CoreOS 43, CentOS Stream 10 bootc, Fedora Silverblue 43 — any ostree/bootc system with LUKS root.
Ignition Version
All versions that provision LUKS (the storage.luks config section).
Environment
Any — qemu, bare metal, cloud. Reproducible on FCOS 43 qemu with the LUKS root-reprovision kola test.
Expected Behavior
After Ignition provisions a LUKS root device on an ostree system, systemctl soft-reboot should work. The LUKS device should survive soft-reboot shutdown so that /sysroot, /var, and /boot remain available.
Actual Behavior
Soft-reboot fails with var.mount failure and the system drops to emergency shell. The LUKS device is torn down during soft-reboot shutdown because systemd-cryptsetup-generator writes Conflicts=umount.target into the cryptsetup service unit. This causes a cascade: cryptsetup is stopped, the dm-crypt device is removed, /sysroot loses its backing device, and /var (a bind mount from /sysroot) fails to mount.
On non-ostree systems this cascade is harmless — the kernel root mount (-.mount, Perpetual=yes) pins the LUKS device and cryptsetup detach fails with EBUSY. On ostree, /sysroot is a regular mount (not the kernel root), so the detach actually succeeds.
The systemd-cryptsetup-generator skips Conflicts=umount.target when the crypttab entry has the x-initrd.attach option. Ignition writes /etc/crypttab but does not include this option.
Reproduction Steps
- Boot FCOS with an Ignition config that provisions LUKS root (e.g., the
root-reprovision/lukskola test config withstorage.luks+ clevis TPM2) - After provisioning completes and the system reboots, run
systemctl soft-reboot - System drops to emergency shell —
var.mountfails
Other Information
Proposed fix
When Ignition provisions LUKS on an ostree system (detected via /run/ostree-booted), add x-initrd.attach to the crypttab entry's options field in createCrypttabEntries(). This tells systemd-cryptsetup-generator not to add Conflicts=umount.target, preventing the teardown cascade during soft-reboot.
Alternatively, Ignition could always add x-initrd.attach for LUKS devices that back the root filesystem, since on any system where the initrd manages LUKS setup, the device should persist across soft-reboot.
Why rd.luks.options=x-initrd.attach as a kernel argument does not work
The systemd-cryptsetup-generator processes /etc/crypttab first via add_crypttab_devices(). When it finds the device in crypttab, it creates the unit using crypttab options (which don't include x-initrd.attach) and marks the device as created. Later, add_proc_cmdline_devices() skips the device because it was already created from crypttab. The rd.luks.options= default options are never applied. The crypttab must contain the option directly.
Current workaround
There is no shipped workaround. The ostree PR ostreedev/ostree#3571 fixes soft-reboot for var, sysroot, and boot mounts on plain disk and RAID, but does not address the LUKS case. A prototype fix was validated during development but removed from the PR because the proper fix belongs in the provisioning tool that writes the crypttab. That lives on https://github.com/jmarrero/ostree/tree/fix-soft-reboot-var-mount-2
Users can work around the issue manually by adding x-initrd.attach to their /etc/crypttab options field.
Related issues
- generator: Add DefaultDependencies=no to var.mount for soft-reboot ostreedev/ostree#3571 — ostree fix for soft-reboot (var, sysroot, boot)
- soft-reboot: fails to boot with Anaconda+LUKS ostreedev/ostree#3503 — original report: soft-reboot fails with Anaconda+LUKS
- cryptsetup: Don't try to tear down LUKS devices with
rd.luksduring shutdown systemd/systemd#38803 — systemd RFE: cryptsetup generator should automatically implyx-initrd.attachforrd.luksdevices (would make this Ignition change unnecessary if implemented) - https://issues.redhat.com/browse/RHEL-154075 — RHEL tracking bug for bare soft-reboot failure
- https://issues.redhat.com/browse/RHEL-112702 — RHEL tracking for LUKS+soft-reboot
Activity
[-]Add x-initrd.attach to crypttab when provisioning LUKS on ostree systems[/-][+]ostree systems with LUKS fails to boot after a systemctl soft-reboot[/+]internal/exec/stages/files: add tests for LUKS ostree soft-reboot
internal/exec/stages/files: add x-initrd.attach for LUKS on ostree
internal/exec/stages/files: add tests for LUKS ostree soft-reboot
internal/exec/stages/files: add x-initrd.attach for LUKS on ostree
internal/exec/stages/files: add tests for LUKS ostree soft-reboot
internal/exec/stages/files: add x-initrd.attach for LUKS on ostree
WIP: use soft-reboot on top of luks and mdraid tests.
jmarrero commentedon Apr 9, 2026
I did some simple modification to existing CoreOS tests that we could merge once this is fixed or use them to test the fix to this as well. jmarrero/fedora-coreos-config@b10570f#r181870776
prestist commentedon Apr 9, 2026
@jmarrero thank you!
I have a wip as well for fixing it. For those tests that you added wont we need an ignition release? 😢
jmarrero commentedon May 1, 2026
Yeah, but I think it's not super urgent at the moment. (Famous last words) I guess it could be pretty bad if someone triggers a soft-reboot and does not know this. But this has been broken for a while.
prestist commentedon May 6, 2026
@jmarrero good news we landed some other changes that will def need a release so I am going to prioritize getting this in for that release.