Manjaro mit LUKS2 und GRUB

uuid bestimmen:

[user-virtualbox user]# blkid  
/dev/sr0: BLOCK_SIZE="2048" UUID="2021-09-27-20-16-48-00" LABEL="MANJARO_KDE_2114" TYPE="iso9660" PTTYPE="dos"  
/dev/mapper/luks-b042f012-1579-4bd6-8a8f-cc26dec62d17: UUID="8e566960-e0f0-4f81-a22b-6b289123ae2c" BLOCK_SIZE="4096" TYPE="ext4"  
/dev/sda2: UUID="b042f012-1579-4bd6-8a8f-cc26dec62d17" TYPE="crypto_LUKS" PARTLABEL="root" PARTUUID="c88f144a-0648-bd44-89d9-19a308fd5e37"  
/dev/sda1: LABEL_FATBOOT="NO_LABEL" LABEL="NO_LABEL" UUID="8AE2-31C5" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="be42ca53-a961-f146-9940-c032a02acae2"

LUKS Platte konvertieren: (darf nicht in-use sein)

cryptsetup convert /dev/sda2 --type luks2 --pbkdf=pbkdf2

Grub anpassen

mount

[manjaro@manjaro ~]$ sudo su  
[manjaro manjaro]# cryptsetup luksOpen /dev/sda2 luks_root  
Geben Sie die Passphrase für »/dev/sda2« ein:    
[manjaro manjaro]# mount /dev/mapper/luks_root /mnt/  
[manjaro manjaro]# mount /dev/sda1 /mnt/@/boot/efi/  

UUID für GRUB Config bestimmen:

[manjaro manjaro]# lsblk -no TYPE,UUID /dev/sda2 | awk '$1=="part"{print $2}' | tr -d -   
b042f01215794bd68a8fcc26dec62d17

Config erstellen

https://wiki.archlinux.org/title/GRUB#LUKS2

/tmp/grub-pre.cfg

# replace ... by the output of: lsblk -no TYPE,UUID _/dev/nvme0n1p2_ | awk '$1=="part"{print $2}' | tr -d -
set crypto_uuid=b042f01215794bd68a8fcc26dec62d17
cryptomount -u $crypto_uuid
# Replace crypto0 by lvm/NameOfVolume if you use LVM
set root=crypto0
set prefix=($root)/boot/grub
insmod normal
normal

btrfs: /tmp/grub-pre.cfg

set crypto_uuid=4b4ed4284b244a22bd2d5f8e61dcee7a
cryptomount -u $crypto_uuid
set root=crypto0
set prefix=($root)/\@/boot/grub
insmod normal
normal

GRUB Image erstellen:

btrfs: grub-mkimage -p /boot/grub -O x86_64-efi -c /tmp/grub-pre.cfg -o /tmp/grubx64.efi luks2 part_gpt cryptodisk gcry_rijndael pbkdf2 gcry_sha256 btrfs ext4: grub-mkimage -p /boot/grub -O x86_64-efi -c /tmp/grub-pre.cfg -o /tmp/grubx64.efi luks2 part_gpt cryptodisk gcry_rijndael pbkdf2 gcry_sha256 ext2 ### Image in EFI kopieren/installieren: install -v /tmp/grubx64.efi /mnt/\@/boot/efi/EFI/Manjaro/grubx64.efi