Guides:
- https://stephentanner.com/restoring-grub-for-an-encrypted-lvm.html
- https://askubuntu.com/questions/719409/how-to-reinstall-grub-from-a-liveusb-if-the-partition-is-encrypted-and-there-i
- https://help.ubuntu.com/community/Grub2/Installing
- https://unix.stackexchange.com/a/414289
# Repair debian work
cryptsetup luksOpen /dev/nvme0n1p3 encrypted
# Repair debian private
cryptsetup luksOpen /dev/nvme1n1p2 encrypted
vgchange -ay
lvscan
mkdir -p /media/linux
mount /dev/mapper/encrypted /media/linux/
mount -o bind /proc /media/linux/proc
mount -o bind /dev /media/linux/dev
mount -o bind /sys /media/linux/sys
# needed for efivars
mount -t devpts pts /media/linux/dev/pts/
chroot /media/linux /bin/bash
> fdisk -l:
Disk /dev/nvme1n1: 476.96 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SAMSUNG MZVLB512HAJQ-00000
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BFF47E0A-5412-4D63-A954-10275C9785F7
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 2549759 1499136 732M Linux filesystem
/dev/nvme0n1p3 2549760 1000214527 997664768 475.7G Linux filesystem
# Debian work
mount /dev/nvme0n1p2 /boot
# Debian private
mount /dev/nvme1n1p1 /boot
mount /dev/nvme0n1p1 /boot/efi
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
# debian work
grub-install /dev/nvme0n1 --bootloader-id debian
# debian private
grub-install /dev/nvmen1 --bootloader-id debianpriv
umount /boot/efi
umount /boot
leave chroot
exit
umount /media/linux/boot/efi
umount /media/linux/boot
umount -l /media/linux
vgchange -an
cryptsetup luksClose encrypted