This is a step-by-step guide for making your Raspberry Pi 5 more secure and powerful by using encrypted rootfs and btrfs. It is highly recommended to use NVME drive as a boot device for this setup to work properly. Installing NVME drive as a boot partition and enabling SSH autostart is outside of the scope of this guide. This guide is inspired by this AskUbuntu! answer and this btrfs guide.
This method of installation is completely headless, but can also be performed on the device itself.
All commands in this guide are executed from root account (aka with sudo).
Don't forget to make a backup of your system BEFORE attempting any changes. It is highly recommented to do this conversion after the initial install of Raspberry Pi OS, before adding any new data to the system, in case something