bootc-filesystem-encryption - Man Page

Disk encryption (e.g. LUKS)

Description

bootc supports any Linux filesystem and block storage setup, and does not dictate any particular architecture. Once a writable Linux filesystem is mounted, bootc can write content (images) into it, in the same way e.g. podman, apt, and dnf do.

Concretely bootc install to-filesystem and bootc upgrade both operate on pre-existing mounted filesystems. This includes LUKS and RAID underneath for block storage.

However, LUKS is important enough that it deserves its own documentation.

Recommendation: handle root filesystem encryption independently of bootc

If you want an encrypted root, set that up independently of bootc, and then point bootc install to-filesystem at the resulting mounted filesystem.

Reference implementations:

Whichever you use, that setup is owned by whoever builds and maintains the image or installer, not by bootc.

/boot or XBOOTLDR partition

Some layouts need a separate /boot or XBOOTLDR partition — for example tpm2-luks requires one, since GRUB and most bootloaders can't read a LUKS-encrypted /boot​. If yours does, pass --boot-mount-spec to to-filesystem so bootc knows where to install boot assets. See More advanced installation with to-filesystem (see bootc-installation(7)).

Root filesystem discovery

This is no different from non-LUKS cases; either use discoverable partitions or root= plus luks.uuid style kernel arguments.

First-boot encryption of an already-populated filesystem

It's common to have a "golden image" (a KubeVirt containerdisk, a raw ​.qcow2, an AMI, and similar) that is already a bootc install (i.e. the target OS) already. Typically, the filesystem is not already encrypted, because there'd be nothing to use as a default unlocking mechanism. Hence encrypting each instance uniquely means converting that already-populated partition to LUKS2 in place, the first time it boots. This is OS/distro-level work, not something bootc implements.

Fedora CoreOS is a reference architecture here: its disk images ship unencrypted, and Ignition ⟨https://coreos.github.io/ignition/⟩ can convert the root filesystem to LUKS2 in place during the initramfs of the machine's first real boot, optionally bound via clevis to tpm2, tang (network-bound unlock), or a Shamir threshold across several pins. See the Fedora CoreOS storage docs ⟨https://docs.fedoraproject.org/en-US/fedora-coreos/storage/⟩ for details. Other notes and prior art:

This only protects data written after the per-device encryption boundary exists; don't provision machine-specific secrets into the image before that boundary is in place.

Tracking

The following issues track requests to extend tpm2-luks further (configurable PCRs, recovery keys, deferred/first-boot enrollment). Given the direction above, the expectation is that these are better solved by using systemd-cryptsetup/systemd-cryptenroll directly in your own initramfs rather than by adding more options to bootc's installer:

See Also

bootc(8), bootc-docs(7), bootc-installation(7)

Version

v1.17.1