BOOTC-FILESYSTEM-ENCRYPTION(7)
πΎ BOOTC-FILESYSTEM-ENCRYPTION(7) π
okay so bestie, welcome to section 7 of the Miscellaneous Information Manual, and today we are talking about the thing that makes everybody's laptop feel mysterious: disk encryption. Specifically, this page is bootc-filesystem-encryption, and it is all about LUKS and friends. let's get into it π«Ά
β¨ NAME β¨
bootc-filesystem-encryption β disk encryption (e.g. LUKS)
πΈ DESCRIPTION πΈ
okay first things first: bootc is not picky. it supports literally any Linux filesystem and block storage setup, and it does not dictate any particular architecture. once a writable Linux filesystem is mounted, bootc can just write content (images) into it, exactly the same way podman, apt, and dnf do. it's giving "i go where i'm mounted" energy π
concretely: bootc install to-filesystem and bootc upgrade both operate on pre-existing mounted filesystems. and yes, that includes LUKS and RAID underneath for block storage. so the block layer can be doing whatever it wants, bootc does not care.
however π β LUKS is important enough that it deserves its own documentation. so here we are.
π Recommendation: handle root filesystem encryption independently of bootc
bestie, listen. if you want an encrypted root, set that up independently of bootc, and then point bootc install to-filesystem at the resulting mounted filesystem. that's the whole vibe. bootc is the guest, you're the host, you handle the locks π
Reference implementations, i.e. the girlies who already did this:
- Anaconda β¨
https://github.com/rhinstaller/anaconda/β©, via itsbootckickstart command (which drivesto-filesystemdirectly): kickstart's--encryptedoptions set up LUKS during install, and a%postscript can add TPM2 binding withsystemd-cryptenroll. iconic behaviour tbh. - β¨
https://www.freedesktop.org/software/systemd/man/latest/systemd-cryptsetup@.service.htmlβ© and β¨https://www.freedesktop.org/software/systemd/man/latest/systemd-cryptenroll.htmlβ© directly, for installers or provisioning tooling that don't use Anaconda. note that data for this can be provided via β¨https://www.freedesktop.org/software/systemd/man/latest/systemd-imdsd@.service.htmlβ© (systemdv261+): on recognized clouds. β¨
whichever one you use, that setup is owned by whoever builds and maintains the image or installer β not by bootc. periodt.
π¦ /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. rude of them honestly.
if yours does need one, 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 one is no different from non-LUKS cases, lowkey. either use discoverable partitions, or root= plus luks.uuid style kernel arguments. that's it, that's the whole thing.
π₯ First-boot encryption of an already-populated filesystem
okay so this is the scenario: it's super common to have a "golden image" (a KubeVirt containerdisk, a raw .qcow2, an AMI, and similar) that is already a bootc install β like, it's already the target OS, bestie. typically, the filesystem is not already encrypted, because there'd be nothing to use as a default unlocking mechanism. makes sense, right?
hence encrypting each instance uniquely means converting that already-populated partition to LUKS2 in place, the first time it boots. and no cap: 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:
- openSUSE's β¨
https://github.com/openSUSE/disk-encryption-toolβ© β shipping today via a dracut hook that runscryptsetup reencrypt --encrypt --reduce-device-size=<n>before the partition is ever mounted. slay. - β¨
https://github.com/systemd/systemd/pull/29731β© β open, unmerged RFC upstream. we wait π°οΈ
β οΈ real talk: 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. like, do not do that. π
π Tracking
the following issues track requests to extend tpm2-luks further (configurable PCRs, recovery keys, deferred/first-boot enrollment, all of it). 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. iykyk.
#421β¨https://github.com/bootc-dev/bootc/issues/421β© install to-disk with LUKS + TPM broken#476β¨https://github.com/bootc-dev/bootc/issues/476β© Add config option to configuresystemd-cryptenrollPCRs#477β¨https://github.com/bootc-dev/bootc/issues/477β© LUKS volumes need configurable password and/or recovery keys#1329β¨https://github.com/bootc-dev/bootc/issues/1329β© Support LUKS password onbootc install#2089β¨https://github.com/bootc-dev/bootc/issues/2089β©install to-disk --block-setup tpm2-lukshangs:libdevmapperudev cookie semaphore deadlock in container IPC namespace (closed; background on why install-time LUKS setup inside a container is fragile) π
π SEE ALSO π
bootc(8), bootc-docs(7), bootc-installation(7)
β VERSION β
v1.17.1
and that's the page bestie!! π this was BOOTC-FILESYSTEM-ENCRYPTION(7) from the Miscellaneous Information Manual, version v1.17.1 β go forth and encrypt responsibly, and remember: encrypt your root independently and let bootc do its little write-content-into-mounted-filesystem thing β¨ππ¦
π¦ where this page comes from
- fedora 43: bootc 1.17.1-1.fc43 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
- fedora 44: bootc 1.17.1-1.fc44 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms