This is an old revision of the document!
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
choose the /dev/mapper/crypt “device” and click on “New Partition Table”.
create swap partition at the end of the free space:
next, create your root volume occupying the rest of the free space:
rsult:
now find our boot partition, in our case /dev/nvme0n1p5, slelect it and click “Change”
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/mapper/crypt2 /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
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 PARTLABEL=crypt none luks,discard
update-initramfs -k all -c
reboot