OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
security high occasional DISPUTE

A LUKS keyfile stored on the boot ESP defeats the encryption it is meant to unlock

omarchyarchluksuefilaptopdesktop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy 4.0.2-1 on 2026-09-18
AUDIT NOTE

Gate 2 held for the cause: the Arch wiki Dm-crypt/Device_encryption warning under 'With a keyfile embedded in the initramfs' says exactly what the record leans on, with two conditions, earlier authentication or an encrypted /boot, and the record paraphrased only the second, now both are quoted. The ESP-at-/boot claim was checked against how Omarchy installs, not how Arch can: the ISO configurator sets esp_mount_in_target=/boot when encryption is on and /efi when it is off, so on every encrypted install /boot is the vfat ESP, confirmed here by findmnt /boot. The record's 'always' is now scoped to encrypted installs, the only ones a LUKS keyfile applies to. The fix was wrong on Omarchy and its own cited source says so: it enrolls a TPM2 token with systemd-cryptenroll and adds tpm2-device=auto to /etc/crypttab, but Omarchy's initramfs uses the busybox encrypt hook (omarchy_hooks.conf) driven by cryptdevice= in /etc/limine-entry-tool.d/omarchy-uki.conf. Dm-crypt/System_configuration states that /etc/crypttab is read after the system has booted and is not a replacement for early-userspace unlocking, that the encrypt hook does not support crypttab options, and puts TPM2 unlocking under the sd-encrypt hook via rd.luks.options or x-initrd.attach. Following the record leaves the passphrase prompt in place at best. The fix also never closed the hole for someone who already has a keyfile: no keyslot removal, no UKI rebuild. Rewritten as: do not do it, and if done, find the cryptkey=/FILES= wiring, remove the keyslot (luksRemoveKey, positional keyfile per the local cryptsetup-luksRemoveKey man page), delete the file, rebuild with limine-mkinitcpio, with the sd-encrypt requirement stated and not walked through. verify and danger rewritten to match. Trusted_Platform_Module and the systemd-cryptenroll man page removed as sources because nothing now leans on them, and the configurator is added at a pinned sha. Severity high stands under the brief's scale: possession of the disk yields the credential that unlocks all private data. Not exercised: no keyfile, keyslot, UKI or ESP was touched, and the removal commands were checked against man pages, not run.

The cause above was rewritten on 2026-09-18 to match this note; the fix was corrected by the audit itself.
RISK

This mistake does not fail loudly. The machine keeps booting with no passphrase prompt, so it stays invisible until the drive is lost, stolen or imaged, at which point the encryption protects nothing: the key sits next to the data in the one partition every recovery tool and every other OS can read. Do not "fix" it by moving the keyfile to /boot. On an encrypted Omarchy install /boot is the ESP, the same partition.

When undoing it, remove the keyslot as well as the file, or any surviving copy of the file still unlocks the volume. Test the passphrase with cryptsetup open --test-passphrase before removing a slot, and never remove the last one: a LUKS volume with no remaining keyslot cannot be opened again. Rebuild the UKI after deleting the file, or the old image on the ESP still carries the key.

Symptom

Looking for a way to skip typing the LUKS passphrase on every boot, and finding instructions online for an auto-unlock keyfile embedded in the initramfs or kept on the boot partition. The question worth asking before doing it: is it actually safe to keep the key that unlocks an encrypted disk on the same disk, in a partition nothing has to authenticate to read.

Cause

Omarchy unlocks the root volume in the initramfs with mkinitcpio's busybox encrypt hook (confirmed in /etc/mkinitcpio.conf.d/omarchy_hooks.conf: HOOKS=(... block encrypt filesystems fsck btrfs-overlayfs)), driven by cryptdevice=PARTUUID=...:root in /etc/limine-entry-tool.d/omarchy-uki.conf, and prompts for the passphrase before root is mounted. The Arch wiki's instructions for removing that prompt with a keyfile embedded in the initramfs open with a warning that names two conditions. The first: "Using some form of authentication earlier in the boot process. Otherwise auto-decryption will occur, defeating completely the purpose of block device encryption." The second: "/boot is encrypted. Otherwise root on a different installation (including the live environment) can extract your key from the initramfs, and unlock the device without any other authentication."

On an encrypted Omarchy install neither condition can be met. The installer mounts the EFI System Partition at /boot whenever encryption is on (esp_mount_in_target=/boot in the ISO configurator, confirmed here: findmnt /boot shows a vfat partition), Limine loads a UKI from /boot/EFI/Linux/omarchy_linux.efi with the initramfs inside it, and a UEFI system partition is FAT and cannot be LUKS-encrypted. Nothing authenticates earlier either: the UKI is the first thing in the boot that asks for anything. A keyfile embedded in the initramfs, or kept as a file on the ESP, therefore sits in the one partition on the disk that is never behind the passphrase it removes. The ESP is mounted dmask=0077, so other accounts on the running system cannot read it, but anyone holding the disk can.

Fix

Do not store a LUKS keyfile for the root volume on the ESP, and do not embed one in the initramfs, on an Omarchy install. The passphrase prompt is the only authentication in that boot path.

If you already did, take it back out. Everything below runs from the booted system with the passphrase you still have.

First find where it was wired in. The encrypt hook reads cryptkey= from the kernel command line, or /crypto_keyfile.bin from the initramfs when no parameter is given, and a file gets into the initramfs through a FILES= entry:


grep -n cryptkey /etc/default/limine /etc/limine-entry-tool.d/*.conf
grep -n FILES /etc/mkinitcpio.conf /etc/mkinitcpio.conf.d/*.conf
sudo find /boot -name '*.key' -o -name '*keyfile*'

Remove the cryptkey= parameter and the FILES= entry you added. Leave /etc/mkinitcpio.conf.d/omarchy_hooks.conf alone: its FILES+=(/etc/vconsole.conf) line is Omarchy's own and is not a key.

Then remove the keyslot the keyfile unlocks, so a copy of the file that still exists somewhere (an old UKI, a backup, a snapshot) no longer opens the volume. Confirm your passphrase works before you remove anything:


sudo cryptsetup open --test-passphrase /dev/<your LUKS partition, from lsblk>
sudo cryptsetup luksDump /dev/<your LUKS partition>
sudo cryptsetup luksRemoveKey /dev/<your LUKS partition> /path/to/the/keyfile

Then delete the keyfile and rebuild the UKI, so the copy inside the old image on the ESP is replaced:


sudo rm -f /path/to/the/keyfile
sudo limine-mkinitcpio

If what you wanted was an unlock with no typing, Omarchy's boot path cannot do it safely as shipped. A TPM2 unlock needs the systemd initramfs, the sd-encrypt hook with rd.luks.name= and rd.luks.options=...=tpm2-device=auto, because the busybox encrypt hook does not support crypttab options and /etc/crypttab is read after root is already mounted. Omarchy assigns HOOKS wholesale in omarchy_hooks.conf and its kernel command line uses cryptdevice=, so that is a conversion of the boot path rather than a setting, and this record does not walk through it.

Verify

sudo cryptsetup luksDump /dev/<your LUKS partition> lists only the keyslots you mean to keep, the two grep commands in the fix return nothing, sudo find /boot -name '*.key' returns nothing, and the next boot asks for the passphrase.

Sources

luks-keyfile-on-esp-defeats-encryption