dualboot ubuntu and windows with encrypted ubuntu partition
https://www.mikekasberg.com/blog/2020/04/08/dual-boot-ubuntu-and-windows-with-encryption.html
cryptsetup luksFormat –type=luks1 /dev/nvme0n1p6
cryptsetup open /dev/nvme0n1p6 crypt
pvcreate /dev/mapper/crypt
vgcreate ubuntu-vg /dev/mapper/crypt
lvcreate -L 8G -n swap ubuntu-vg
lvcreate -l 100%FREE -n root ubuntu-vg
next, click on “Install Now” to proceed with the installation.. from now on just do whatever you do to install ubuntu, but when you are done, don't reboot yet, click on “Continue Testing”
open a terminal
mount /dev/ubuntu-vg/root /mnt
mount PARTLABEL=boot /mnt/boot/
for i in dev proc sys etc/resolv.conf; do mount -o bind /$i /mnt/$i; done
chroot /mnt
blkid /dev/nvme0n1p6
nano /etc/crypttab
# <target name> <source device> <key file> <options>
# options used:
# luks - specifies that this is a LUKS encrypted device
# tries=0 - allows to re-enter password unlimited number of times
# discard - allows SSD TRIM command, WARNING: potential security risk (more: “man crypttab”)
# loud - display all warnings
crypt UUID=“879761ba-42bc-455a-9126-fd21fa386f07” none luks,discard
update-initramfs -k all -c
exit
reboot