Why Asahi Linux needs this
Every mainstream Fedora installer offers to encrypt the disk. The Asahi installer does not: it installs Fedora Asahi Remix alongside macOS with a plain btrfs root, and adding LUKS has meant doing it yourself afterwards, by hand. On a laptop that is the gap that matters. A lost or stolen MacBook running Asahi gives anyone your home directory, your browser profiles and your SSH keys, with no passphrase in the way.
macOS on the same disk is protected by FileVault. Linux on that disk can be protected too. The difference is that Linux cannot use the Secure Enclave, so the protection has to come from a strong key-derivation function and a good passphrase. AsahiLocker is built around that.
Your options in 2026
There are three practical ways to get an encrypted Asahi system today:
- Do it by hand. David Alger's 2023 guide is the original walkthrough, and Christian Horn's 2026 update covers what has changed since. Both are good reading if you want to understand every command. You boot a Fedora Asahi live USB, encrypt the root partition, then edit the boot configuration and rebuild the initramfs yourself.
- Run a tool that does the same steps for you, with checks. That is what AsahiLocker is. It automates the hand-editing, verifies the result before you reboot, resumes by itself if it is interrupted, and is the only one of the three that does not need a USB stick. The rest of this page covers it.
- Wait for the installer. Encryption at install time has been requested of the Asahi installer for years. Until it ships, encrypting means doing it after install, by hand or with a tool.
What AsahiLocker does
- In-place btrfs → LUKS2 conversion. No reinstall, no backup-and-restore round trip, no second disk. Subvolumes, snapshots and the btrfs UUID survive; the partition simply gains an encryption layer.
- Every boot file rewritten, then verified.
crypttab,fstab,/etc/kernel/cmdline, GRUB defaults, all BLS entries, dracut config and all initramfs images, behind a 12-point gate that refuses to let you reboot into a broken system. - The strongest KDF by default. AES-256-XTS with argon2id at 4 GiB per guess,
the most memory
cryptsetupallows: five times the work of a stockluksFormat, and a 24 GB GPU fits only about six guesses at once. 2 and 1 GiB profiles are one choice away. Every profile is stronger thancryptsetup's own default on that machine; the script checks that at run time and there is no flag to opt out. Never pbkdf2. - One command.
luks-deploy.sh --listshows every install on the Mac;luks-deploy.sh /dev/nvme0n1p6 --defaultsencrypts one, with/bootand EFI proven from that install's ownfstabrather than guessed from partition order. - No USB stick needed. The built-in RAM rescue boots your own kernel from RAM and encrypts in place. It survives a power cut midway.
- Maintenance built in.
luks-mount.shunlocks, mounts and chroots into any other Asahi install on the Mac, encrypted or not, and locks it all up again when you leave. - Resumable after any interruption. LUKS2 re-encryption is journaled. Lose power, close the lid, kill the terminal: re-run the script and it finishes the job.
- Forgiving where it is safe to be. Mistype the passphrase, or choose one
cryptsetuprefuses as too weak, and it asks again, after proving on the partition that nothing was written. Start it on the system you are sitting in, withoutsudo, or from the wrong place, and it tells you what to run instead, before anything has happened. - A
--dry-runthat really is dry. Detection, menus, fstab cross-checks and the KDF benchmark all run, and it prints the exactcryptsetup reencryptcommand it would issue, then stops before changing anything. - Recovery you can actually use. An optional 64-hex-character recovery key in a second keyslot, plus a labelled bundle containing the LUKS header and every changed config.
- Asahi-specific boot guards. One puts the ESP stub back the moment a stray
grub2-mkconfigoverwrites it, before it can drop you intogrub rescue>(Fedora's own check for that never fires on Asahi). The other clears stale U-Boot EFI entries fromubootefi.var, the file they actually live in. Re-running the installer upgrades guards from any earlier release. - No swap left behind. A swap partition, or a swap file outside the root, would put what the kernel swaps out on the disk unencrypted. The installer finds it and stops until you say so.
- An optional boot tripwire. It records every file on
/bootand the EFI partition on the encrypted root, and tells you at the next boot if any changed while the Mac was off. Updates, Discover's offline updates included, are recorded as they happen and raise no alarm; a changed/bootis never recorded over until you accept it.
Asahi-specific boot guards
Two ways an Apple Silicon Mac running Fedora Asahi Remix loses its boot are particular to this
platform, and neither Fedora nor the Asahi installer guards against either.
boot-guards/install.sh adds both; running it again upgrades guards from any earlier
release.
The GRUB stub on the EFI partition. /boot/efi/EFI/fedora/grub.cfg is
a three- or four-line stub that finds /boot. Overwrite it with a full config, as
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg does, and an encrypted Mac stops at a
GRUB prompt. Fedora's own check for that looks under EFI/$ID/, and on Asahi
ID is fedora-asahi-remix, so it never fires. The guard puts the stub
back as soon as the write is closed:
Measured live on a MacBook Pro 14" (M2 Max), Fedora Asahi Remix 45, kernel 7.3.4, SELinux enforcing:
| What overwrote the stub | Stub back after the write closed |
|---|---|
A real sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg: 281 lines over the 4-line stub, Fedora's check silent | 19.4 ms |
A rewrite the way grub2-mkconfig writes it, two runs | 17 ms and 26 ms |
SELinux does not let systemd watch a file on the EFI partition, so a guard pointed at
grub.cfg itself installs, reports itself active and never fires; this one watches the
directory.
Stale boot entries. U-Boot keeps its EFI boot entries in ubootefi.var
on the EFI partition, so efibootmgr -B deletes come back at the next boot. The cleaner
edits that file in U-Boot's own format; on the M2 Max above, U-Boot booted the rewritten file.
What it protects, and what it does not
- Protected: a lost or stolen Mac that is switched off, and any image of the disk attacked offline. Every guess at the passphrase costs argon2id at 4 GiB x 10.
- Not protected: a Mac that is on or asleep (the key is in memory), a weak
passphrase, and someone with repeated physical access who changes
/bootor the EFI partition to capture the passphrase at the next boot. Both stay unencrypted and unsigned, as on every Asahi install. The optional boot tripwire tells you afterwards; nothing can prevent it on this platform. - An unencrypted
/bootis normal. Fedora's, Ubuntu's and Debian's installers, the ones most people use, encrypt the root and leave/bootunencrypted. Where an installer does encrypt/boot, GRUB opens it with PBKDF2; an argon2id/bootneeds a GRUB 2.14 built by hand. What installers call "full disk encryption" is the root:/bootstays unencrypted there too.
The evidence: tests, machines, audits
A tool that rewrites your root partition should not be taken on trust, so here is what stands behind this one.
- Three full audits. Every script, every test and every document, three times over. One rule each time: nothing counts as a finding until it has been reproduced, against the code, on a loop device, in a virtual machine, or on a running Mac. The third (November 2026) reproduced thirteen findings on the released code, fixed every one, and then encrypted a fresh system from the RAM rescue and booted it. Version 3.0.0 marks that audited state. The record, findings included, is in the README.
- 187 automated checks on every push. The real
cryptsetupsequence the script runs, against a loop device: encrypt, hard-kill in mid-reencrypt, repair, resume, recovery key, 4096-byte sectors. A passphrase refused at the prompt, which must write nothing. The partition menus on a disk carrying two installs.luks-mount.shon a plain and an encrypted install. The boot guards installed over the previous release's under a real systemd. The command line of every script. - Run end to end before release. Since 2.1.0 every release has been run in a virtual machine on the official Fedora Asahi Remix image, including a power cut in mid-encryption followed by a resume. A VM is not a Mac, and the tested-systems table says exactly what each run did and did not show.
- Run on real Macs by other people. An M3 MacBook Air via the second-install route (Noah Petherbridge's write-up); a 14" M2 Max MacBook Pro from the RAM rescue (issues #7 to #9); a 14" M2 Pro MacBook Pro from the RAM rescue (#10); two M1 machines in PR #5.
- In daily use on three Macs. The author's MacBook Air 13" (M2), MacBook Pro 16" (M1 Pro) and MacBook Pro 14" (M2 Max) were encrypted with it and have asked for the passphrase at every boot since.
- Stronger than stock, enforced. The default profile does five times the
work per guess of a plain
luksFormaton the same Mac. The script measures whatcryptsetupwould have chosen on your machine and will not write anything weaker. There is no flag to turn that off. - Nothing hidden.
--dry-runprints every action without taking it, every script answers--help, and the internals document every file changed and every check in the gate.
How the encrypted boot works on Apple Silicon
U-Boot provides the UEFI environment, and GRUB loads the kernel and initramfs from an
unencrypted ext4 /boot. The initramfs reads
rd.luks.uuid from the kernel command line, asks for your passphrase, runs argon2id,
opens the LUKS2 container and mounts root. GRUB never has to unlock anything, which matters
because GRUB 2.12 (current in Fedora 44) has no argon2 support at all.
nvme0n1
p1 APFS iBootSystemContainer
p2 APFS macOS ← untouched
p3 APFS
p4 vfat EFI /boot/efi ← stays plain
p5 ext4 BOOT /boot ← stays plain
p6 btrfs fedora / /home ← becomes LUKS2(btrfs)
p7 APFS RecoveryOSPartition numbers are detected at run time; that is just the common Asahi shape.
Before you start
- An installed Fedora Asahi Remix system with a btrfs root,
a separate ext4
/bootand a vfat EFI partition. That is the standard layout; check withlsblk -f. - A verified backup: one you have actually browsed or restored from. In-place re-encryption rewrites every sector of the root partition.
- Somewhere to run the encryption from. The script will not encrypt the filesystem it is booted from, and has no override for that. Three ways, all supported: the built-in RAM rescue (nothing to plug in, nothing to install), a Fedora Asahi live USB (a stock Fedora ISO will not boot on Apple Silicon), or a second minimal Asahi install.
- The charger plugged in, and 15–60 minutes for the encryption itself (60–90 minutes all in).
- A passphrase you have chosen in advance and written down somewhere physically safe. There is no TPM on Apple Silicon: the passphrase, or the optional recovery key, is the only way in.
Step by step
No USB stick, or one your Mac will not boot? Skip steps 1
and 2. On the installed system, run
sudo ./AsahiLocker/bin/ram-rescue.sh build --arm, reboot, and type
asahilocker at the rescue prompt. The RAM rescue guide has
the details.
-
Get the kit and build a live USB
On your installed system, clone AsahiLocker and build a Fedora Asahi live USB with leifliddy/asahi-fedora-usb.
build.sherases the target device, so identify the stick carefully.git clone https://github.com/doug445/AsahiLocker.git sudo dnf install arch-install-scripts bubblewrap dosfstools e2fsprogs \ gdisk mkosi openssl pandoc rsync systemd-container git clone https://github.com/leifliddy/asahi-fedora-usb.git cd asahi-fedora-usb lsblk -o NAME,SIZE,TYPE,MODEL,VENDOR # find your USB stick, NOT nvme0n1 sudo su - # build.sh refuses to run under sudo ./build.sh -d /dev/sdX # ← your USB deviceThen copy the AsahiLocker folder onto the stick (
./build.sh mount, copy intomnt_usb/root/,./build.sh umount), so the script is not sitting on the filesystem it is about to encrypt. The live USB's root password isfedora. -
Boot the live USB
Easiest: with the stick plugged in, run this on the installed system, reboot, and pick the new GRUB entry.
sudo grub2-mkconfig -o /boot/grub2/grub.cfgThat exact path, never the ESP one. On Asahi,
/boot/efi/EFI/fedora/grub.cfgmust stay a small chainload stub. Overwriting it drops an encrypted system into a GRUB rescue prompt.Or interrupt U-Boot ("Hit any key to stop autoboot") and boot it from the
=>prompt. If the stick does not show up, runusb startfirst. An unenumerated port is the usual reason a Mac looks like it "cannot boot USB".=> usb start => bootflow scan -l => bootflow select <N> # the usb0 entry, not nvme0 => bootflow boot -
Dry-run it, then encrypt
From the live environment. The dry run shows everything it detected and the exact command it would run, and changes nothing:
sudo /root/AsahiLocker/bin/luks-deploy.sh --list sudo /root/AsahiLocker/bin/luks-deploy.sh /dev/nvme0n1p6 --dry-run sudo /root/AsahiLocker/bin/luks-deploy.sh /dev/nvme0n1p6 --defaults--listshows every install on the Mac and its state. Naming the root partition takes its/bootand EFI from that install's ownfstab, and--defaultstakes the recommended answer to every question that has one: the btrfs check, the default KDF (aggressive;moderateon a Mac with 8 GB), a recovery key. Leave both off and it asks instead.The script auto-detects root,
/bootand EFI, cross-checks them against the target's ownfstab, offers a read-onlybtrfs check, benchmarks your Mac, and asks you to pick a KDF profile. It then shows a pre-flight summary. Read it, and typeencryptto begin. Every word it asks you to type is lower case, and Caps Lock is checked for you: an inverted passphrase verifies fine twice and only fails at the boot prompt. Mistype the passphrase and it asks again; you do not start over.Encryption takes 15–60 minutes. Then come eight configuration steps and the 12-point gate. If any check fails it says so and refuses to declare success. Do not reboot until it passes.
-
First encrypted boot
Reboot and remove the USB. The passphrase prompt often scrolls behind boot text. If the screen looks frozen just after GRUB, it is waiting for you: type the passphrase and press Enter. Unlock takes about 2–10 seconds depending on the profile.
-
Finish on the encrypted system
sudo ./AsahiLocker/bin/post-encryption-setup.sh sudo ./AsahiLocker/boot-guards/install.shThis saves a recovery bundle, creates snapper subvolumes on the encrypted volume, restores the boot splash, and installs the two boot guards. Then copy the recovery bundle off the machine. On the drive it protects, it is no use to you.
-
Verify
lsblk -f | grep crypt sudo cryptsetup luksDump /dev/nvme0n1p6 # PBKDF: argon2id, AF hash: sha512 grep rd.luks /boot/loader/entries/*.conf systemctl --failed
Something went wrong? Nothing is lost yet. The
recovery guide
starts with a table: what you see, what state that means, and what to do. It covers an
interrupted encryption, a box that will not boot, SELinux denials, a damaged header and a
grub rescue> prompt.
Choosing an argon2id profile
The key-derivation function runs once at every boot, and once per guess for anyone attacking a copy of your disk. argon2id is memory-hard: every guess needs gigabytes of RAM, and that memory requirement limits how many guesses a GPU or ASIC can run at once. The installer benchmarks your machine and shows an estimate for each profile:
| Profile | Memory | Iterations | Unlock, M2 Max | Work vs cryptsetup default |
|---|---|---|---|---|
aggressive (default*) | 4 GiB | 10 | 9.5 s (measured) | 5× |
moderate | 2 GiB | 8 | ~4.2 s | 2× |
fast | 1 GiB | 9 | ~2.7 s | 1.125× |
* On any Mac with 8 GB, whatever the chip, the default is moderate: the memory must
be free in the initramfs at every boot, and 4 GiB is half of that machine. All three use 4 threads,
AES-256-XTS and sha512. You can
re-cost a keyslot later without re-encrypting anything, using bin/luks-tune.sh. The
full reasoning is in the argon2id guide,
including how this compares with FileVault's KDF on the same disk.
Manual encryption vs AsahiLocker
| By hand | AsahiLocker | |
|---|---|---|
| Partition selection | You identify root, boot and EFI yourself | Auto-detected, type-checked, cross-checked against the target's fstab |
| KDF parameters | cryptsetup auto-benchmarks: machine-dependent, sha256 | Pinned argon2id + sha512, chosen from a menu benchmarked on your Mac |
| Boot config | Edit crypttab, fstab, cmdline, GRUB defaults and every BLS entry by hand | All rewritten, including every BLS entry and every initramfs |
| Did it work? | You find out at reboot | 12-point gate refuses the reboot until it passes |
| Interrupted run | You debug the header state | Detected and resumed; cryptsetup repair handled |
| Mistyped passphrase | cryptsetup exits; you start again | Proves nothing was written, then asks again |
| Needs a USB stick | Yes, or a second install | No: built-in RAM rescue |
| Tested | On your disk, by you | 187 checks on every push; real Macs; three full audits |
| SELinux | Relabel yourself, or boot into AVC denials | Relabelled and verified |
| Recovery | Whatever you thought to save | Header backups + a labelled bundle of every changed file |
| Asahi footguns | grub2-mkconfig clobbering the ESP stub; stale U-Boot entries | Boot guards undo both |
Which Macs
Every M-series Mac that Fedora Asahi Remix boots, laptop or desktop: MacBook Air and Pro, Mac mini, Mac Studio, iMac and the 2023 Mac Pro, across M1, M2 and M3. Nothing in the tooling is model-specific; partitions, sector size and initramfs contents are all read at run time.
- Verified in production: MacBook Air 13" M2, MacBook Pro 16" M1 Pro and MacBook Pro 14" M2 Max, all three encrypted in place and unlocked at every boot.
- Reported working: M3 MacBook Air, via the second-install route (Noah Petherbridge's write-up).
- Reported working: 14" MacBook Pro M2 Max, from the RAM rescue (issues #7 to #9).
- Not claimed: M4 and later (M4 Pro and Max, M5, the A18 Pro MacBook Neo). The kernel ships their device trees, but Asahi does not boot them yet.
Desktop owners should read the compatibility notes first: a Bluetooth keyboard cannot type the passphrase at boot.
Risks: read these
- No TPM on Apple Silicon. You type the passphrase at every boot. That is the platform, not a limitation of the tool.
- Forget the passphrase and the data is gone, unless you enrolled the recovery key and can still find it. There is no backdoor.
- Have a verified backup. Re-encryption rewrites every sector of the root partition.
- LUKS protects data at rest, not boot integrity.
/bootis unencrypted and unsigned; an attacker with repeated physical access could tamper with the initramfs. The optional boot tripwire reports such changes at the next boot. - You cannot brick the Mac. macOS lives on APFS partitions this tool never touches, and Apple Silicon DFU and System Recovery always work.
- This is unofficial. It is not part of, or supported by, Asahi Linux or the Fedora Project. Please do not take problems with it to their trackers; open an AsahiLocker issue instead.
Frequently asked questions
Can I encrypt Fedora Asahi Remix after installing it?
Yes, that is exactly what this is for. The Asahi installer has no encryption option, so without a tool, encrypting means doing it by hand. AsahiLocker converts the existing btrfs root in place, and your installed system, subvolumes, snapshots and btrfs UUID all survive.
Does it touch or wipe macOS?
No. macOS lives on separate APFS partitions that AsahiLocker never reads or writes. Only the btrfs Linux root partition is converted.
Why a passphrase at every boot? Can't it use the Secure Enclave?
There is no TPM on Apple Silicon, and Asahi has no interface to seal a key in the Secure Enclave, so there is nowhere safe to keep an auto-unlock key. That is why the KDF is argon2id and why the passphrase advice is not optional.
Why is /boot left unencrypted?
Because that is the normal LUKS arrangement: Fedora's, Ubuntu's and Debian's installers
encrypt the root and leave /boot unencrypted, and where an installer does encrypt
/boot, GRUB opens it with PBKDF2. On a Mac it would protect almost nothing: m1n1 stage 2, U-Boot and GRUB
sit on the EFI partition, which nothing can encrypt. Measured on an M2 Max, GRUB's argon2id is
also 8.5 times slower than the kernel's. The
research
is retired and kept as a record; the FAQ has the details.
What if the encryption is interrupted: power loss, a crash, a closed lid?
Nothing fatal. LUKS2 re-encryption is journaled. Boot the live USB or the RAM rescue, re-run
luks-deploy.sh, and it detects the interrupted state and resumes, running
cryptsetup repair first if needed. A hard kill mid-reencrypt is part of the
loopback test suite that runs in CI on every push.
Will it work on a Mac with 8 GB of RAM?
Yes. On any Mac with 8 GB, M1, M2 or M3, the default profile is moderate (2 GiB x 8, twice
the work per guess of cryptsetup's own default): the memory must be free in the
initramfs at every boot, and 4 GiB is half of that machine. aggressive stays on the
menu.
My Mac won't boot from USB. Am I stuck?
No, and you do not need USB at all. The built-in RAM rescue boots
your own kernel from RAM and encrypts in place:
sudo ./AsahiLocker/bin/ram-rescue.sh build --arm, reboot, type
asahilocker. If you would rather use a stick, try usb start at the
U-Boot prompt first; and a second minimal Asahi install on the
internal disk is the third supported route.
Can I deploy it across several Macs unattended?
Yes. Environment variables pin the KDF, partitions and passphrase file so no menu appears. Read FLEET.md first: imaging several boxes from one source creates a real UUID-uniqueness problem.
How do I know it is safe to run?
Don't take it on trust. Run --dry-run and read what it would do;
INTERNALS.md
documents every file it changes and every gate check. 187 automated checks run on
every push, among them the exact encrypt, hard-kill, repair and resume sequence against a
throwaway loop device. It has been audited in full three times, every finding reproduced
before it was fixed; the record is in the
README, and
the evidence is summarised above.
I'm not on Apple Silicon. Is there a version for my PC?
Yes: LinuxLocker applies the same in-place LUKS2 approach to other distros and filesystems, handles systemd-boot as well as GRUB, and re-signs Unified Kernel Images for Secure Boot.
Guides
The repository documentation, published as pages of their own:
- Build and boot a Fedora Asahi Remix live USB on an Apple Silicon Mac — How to build a Fedora Asahi Remix live USB with asahi-fedora-usb and boot it on an Apple Silicon Mac (M1, M2, M3): the m1n1 requirement for M3, and what to do when U-Boot cannot see the stick.
- U-Boot bootflow: booting a USB stick or a specific kernel on Apple Silicon — Booting a USB stick or a chosen kernel on an Apple Silicon Mac from the U-Boot prompt: bootflow scan, picking an entry, persisting the boot order, and why efibootmgr misleads you on Asahi.
- Encrypting Fedora Asahi Remix from a RAM-only rescue, with no USB stick — Encrypt an installed Fedora Asahi Remix system with no USB stick and no second install: your own kernel, booted from RAM.
- Encrypting Fedora Asahi Remix from a second, minimal Asahi install — Encrypt an installed Fedora Asahi Remix system without a live USB.
- Which Apple Silicon Macs work: M1, M2 and M3 compatibility for AsahiLocker — Which Apple Silicon Macs run Fedora Asahi Remix with LUKS2 encryption.
- argon2id and AES-256-XTS for LUKS2 on Apple Silicon: choosing a KDF profile — Choosing an argon2id profile for LUKS2 on an Apple Silicon Mac, changing the KDF on a volume that already exists, why pbkdf2 is never used, and how this compares with FileVault's key derivation.
- Recovery: every failure mode of in-place LUKS2 encryption on Asahi, and the way out — Every failure mode of in-place LUKS2 encryption on Fedora Asahi Remix and how to get out: undoing the btrfs shrink, resuming an interrupted re-encryption, repairing an encrypted root that will not boot.
- Encrypting Fedora Asahi Remix by hand — Every command to encrypt an installed Fedora Asahi Remix root with LUKS2 and argon2id by hand, one per line, then AsahiLocker's boot guards. Run end to end on the official Fedora Asahi Remix 45 image.
- Asahi Linux disk encryption: frequently asked questions — Answers on encrypting Asahi Linux after install.
Credits and further reading
- Fedora Asahi Remix on Apple Silicon with LUKS encryption, David Alger (2023): the manual method, and where most people started.
- Fedora Asahi Remix with LUKS encryption in 2026, Christian Horn: the manual method, updated.
- Asahi Linux with LUKS Encryption, Noah Petherbridge (September 2026): a real end-to-end AsahiLocker run on an M3 MacBook Air. AsahiLocker's second-install route came out of it.
- asahi-fedora-usb, Leif Liddy: the live USB builder this guide uses.
- Asahi Linux: the project that makes any of this possible.