This guide will install Debian Linux OS, encrypted, in HDD, external hard drive or USB stick, both in EFI and Legacy BIOS.
The encryption setup is LVM on LUKS
https://wiki.archlinux.org/title/dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
+-----------------------------------------------------------------------+ +----------------+
| Logical volume 1 | Logical volume 2 | Logical volume 3 | | Boot partition |
| | | | | |
| [SWAP] | / | /home | | /boot |
| | | | | |
| /dev/MyVolGroup/swap | /dev/MyVolGroup/root | /dev/MyVolGroup/home | | |
|_ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _| | (may be on |
| | | other device) |
| LUKS2 encrypted partition | | |
| /dev/sda1 | | /dev/sdb1 |
+-----------------------------------------------------------------------+ +----------------+
The boot partition will not be encrypted!!
The partitioning was made assuming 16GB of capacity. This allow the setup to even run in a cheap 16 GB USB stick.
In a medium with more storage capacity, the / and /home partitions should be bigger than the ones of this guide. But it all depends on the use case and the storage available.
Using 80GB for / and the rest for /home it will be enough for most users. The size chosen for /home it also depends in what it will be stored there and the use case. And if you want to also use the medium to something else, choose the size accordingly. 80GB will be a good size for /home. If you plan to store pictures and videos in there, use more.
Just boot your new install immediately after finishing the installation process. Don't remove anything from your system beside the installation DVD or CD if you use them for installation. If you used a USB stick don't remove it, because this can change the layout of the disks in your system.
If you have already a EFI partition on your system, this setup will use it instead the one you created in the partition process.
But that can be changed. See the part two of this guide.
Note: The encryption setup is based in the following guides:
https://wiki.archlinux.org/title/dm-crypt/Encrypting_an_entire_system
https://wiki.archlinux.org/title/dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
http://ftp.slackware.com/pub/slackware/slackware-14.1/README_CRYPT.TXT