You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming a Linux live or rescue system is booted and the new soon-to-be root encrypted partition is accessible on an NVMe drive, 2nd partiton (/dev/nvme0n1p2).
The EFI partition is the first on the device (/dev/nvme0n1p1).
There is no extra /boot partition since it should be encrypted as well and is included in the partition mounted as root / later.
The following requires root privileges, a preceeding sudo -i is assumed.
mkdir -p /target
cryptsetup luksOpen /dev/nvme0n1p2 cryptdata
mount /dev/mapper/cryptdata /target/ -osubvol=@,ssd,noatime,commit=120,compress=zstd
mount /dev/mapper/cryptdata /target/home/ -osubvol=@home,ssd,noatime,commit=120,compress=zstd
mount /dev/nvme0n1p1 /target/boot/efi
for i in /dev /proc /dev/pts /sys /run /sys/firmware/efi/efivars; do
mount --bind $i /target/$i;
done
chroot /target
for mod in $(cat ~/grub-mods); do
if [ -f "/usr/lib/grub/x86_64-efi/$mod.mod" ]; then
echo $mod;
fi;
done > ~/grub-mods.verified
# append the luks2 module to the list
echo luks2 >> ~/grub-mods.verified
4. Move the old grubx64.efi aside:
cd /boot/efi/EFI/ubuntu/ && mv -i grubx64.efi grubx64.efi.old
5. Build a new grubx64.efi including the luks2 module