Encrypt Asahi Linux with LUKS2, in place › Encrypt Asahi Linux by hand: LUKS2 in place, one command per line

Recovery · chroot · initramfs

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.

Part of the AsahiLocker guide. This page is docs/RECOVERY.md from the repository, last changed 2026-11-29.

In-place LUKS2 encryption of an installed Fedora Asahi Remix root, done by hand, then AsahiLocker's boot guards on top. This is what luks-deploy.sh automates.

Commands

Encrypt (as root, on the live USB):

ROOT=/dev/nvme0n1p6 BOOT=/dev/nvme0n1p5 EFI=/dev/nvme0n1p4    # your btrfs root, ext4 /boot, vfat EFI
btrfs check --readonly $ROOT                                  # stop here if it finds errors
mount $ROOT /mnt && btrfs filesystem resize -32M /mnt && umount /mnt   # room for the LUKS2 header
cryptsetup reencrypt --encrypt --type luks2 --cipher aes-xts-plain64 --key-size 512 --hash sha512 \
  --pbkdf argon2id --pbkdf-memory 4194304 --pbkdf-force-iterations 10 --sector-size 4096 --reduce-device-size 32M $ROOT
cryptsetup open $ROOT fedora_crypt                            # the passphrase you just set
LUKS=$(blkid -s UUID -o value $ROOT); BTRFS=$(blkid -s UUID -o value /dev/mapper/fedora_crypt)
mount -o subvol=root /dev/mapper/fedora_crypt /mnt && btrfs filesystem resize max /mnt
mount -o subvol=home /dev/mapper/fedora_crypt /mnt/home && mount $BOOT /mnt/boot && mount $EFI /mnt/boot/efi
for d in dev dev/pts proc sys run; do mount --bind /$d /mnt/$d; done   # not --rbind: it won't unmount

Configure the encrypted system to boot:

echo "fedora_crypt UUID=$LUKS none luks,discard" >> /mnt/etc/crypttab
sed -i "s|UUID=$BTRFS|/dev/mapper/fedora_crypt|" /mnt/etc/fstab
sed -i "1s|\$| rd.luks.uuid=$LUKS rd.luks.name=$LUKS=fedora_crypt|" /mnt/etc/kernel/cmdline
sed -i "s|^GRUB_CMDLINE_LINUX_DEFAULT=\"|&rd.luks.uuid=$LUKS rd.luks.name=$LUKS=fedora_crypt |" /mnt/etc/default/grub
chroot /mnt grubby --update-kernel=ALL --args="rd.luks.uuid=$LUKS rd.luks.name=$LUKS=fedora_crypt"
echo 'add_dracutmodules+=" crypt dm "' > /mnt/etc/dracut.conf.d/99-luks.conf
chroot /mnt dracut --regenerate-all --force                   # every initramfs, now able to unlock
chroot /mnt grub2-mkconfig -o /boot/grub2/grub.cfg            # /boot/grub2, NEVER /boot/efi/...
touch /mnt/.autorelabel                                       # SELinux relabels at first boot
cryptsetup luksHeaderBackup $ROOT --header-backup-file /root/luks-header.img   # copy it off the Mac
umount -R /mnt && cryptsetup close fedora_crypt && reboot

Add the boot guards (on the encrypted system, after the first boot):

git clone https://github.com/doug445/AsahiLocker.git
sudo ./AsahiLocker/boot-guards/install.sh                     # stub guard + stale EFI entry cleaner
systemctl status esp-grub-stub-guard.path                     # "active (waiting)"
sudo ./AsahiLocker/extras/boot-tripwire/install.sh            # optional: report /boot changed while off

Conclusion

The root and /home are now LUKS2 with argon2id at 4 GiB x 10, the strongest cryptsetup allows; you type the passphrase at every boot. /boot and the EFI partition stay unencrypted, as on every standard LUKS install, and the boot guards undo a stray grub2-mkconfig over the EFI partition's GRUB stub within milliseconds.