[Galaxy Tab S2 Android Development] codiflow:
As for version 18.1 full disc encryption (FDE) is not working (yet) [see this post] I tried it with 19.1 instead and luckily it was successful.

If you want to have FDE with LineageOS 19.1 (Android 12) just follow this tutorial:

Enabling Full-Disc-Encryption (FDE)​

Flash TWRP 3.6​

Get TWRP from here and check checksum beforehand

Press and hold "Home button", "Volume down" and "Power" until the tablet turns on with a turquoise background. Press "Volume up" to proceed to "Download mode"

You are now in "Odin mode" and can flash the new TWRP recovery twrp-3.6.2_9-0-gts210wifi.img

To do so, either use this command heimdall flash --RECOVERY twrp-3.6.2_9-0-gts210wifi.img or check this tutorial which uses heimdall-frontend for this task

Flash Android 12​

Get LineageOS image from here and check checksum beforehand

Boot into TWRP by pressing and holding "Home button", "Volume up" and "Power" until the start screen which says "Samsung Galaxy Tab..." vanishes

Delete ALL current data from the tablet (WARNING!!! Read through it BEFORE you start to follow the steps. And you should backup everything BEFOREHAND!)

Wipe -> "Format Data" -> yes -> Back -> Back

"Advanced Wipe" -> Check "Dalvik / ART Cache", "System", "Data", "Internal Storage" and "Cache" -> "Swipe to Wipe" -> Back -> Back

As an alternative just "Swipe to Factory Reset" – but doesn't remove Magisk if having been installed before

Flash Android 12 image (lineage-19.1-20230814-UNOFFICIAL-gts210wifi.zip)

"Advanced" -> ADB Sideload -> Check both boxes -> "Swipe to Start Sideload"

adb sideload lineage-19.1-20230814-UNOFFICIAL-gts210wifi.zip

"Reboot System" -> "Swipe to Reboot"

Encrypt tablet​

Finish the welcome assistant and set a lockscreen PIN / Password (which will be used as intermediate key for encryption so your device decryption key is always the lockscreen PIN / Password)

Go to Settings -> "Security" -> "Encryption and Credentials" and encrypt the tablet

Tablet reboots and encryption should take around 5-10 seconds. The tablet reboots again and you have to enter the encryption PIN. After entering the PIN the tablet hangs showing the LineageOS boot screen and will never finish. Don't panic.

Reset the tablet by pressing and holding all hardware buttons at the same time until the tablet reboots.

Enter the encryption PIN if asked to do so again and Android will boot successfully for the first time after encrypting the data partition.

Check if everything is still encrypted in Settings -> "Security" -> "Encryption and Credentials".

BUT...​

Decryption of /data in TWRP does NOT work, so backups from within TWRP are NOT an option. Better use Neo Backup from within Android and one way sync the backup folder to some other place e.g. using Syncthing.

Rooting the encrypted device​

Download Magisk from here

Boot into TWRP by pressing and holding "Home button", "Volume up" and "Power" until the start screen which says "Samsung Galaxy Tab..." vanishes

Dismiss the PIN/Password prompt for decrypting the data partition as it does not work either.

"Advanced" -> ADB Sideload -> "Swipe to Start Sideload"

adb sideload Magisk.v26.3.apk

"Reboot System" -> "Swipe to Reboot"

Start Magisk symbol from App launcher (needs working internet connection to download Magisk Manager)

Reflash Magisk from within Magisk Manager (Keep "Force encryption" checked) and choose "Direct installation (recommended)"

Reboot

Restart Magisk Manager and check if everything is alright (version numbers between app and installation are equal and no prompts are popping up)

Install microG (signature spoofing is already built into the LineageOS image)​

Download microG Magisk module from here

Connect the tablet through USB and copy file using ADB: adb push microG_Installer_Revived.zip /sdcard/Download

Start Magisk and enter the modules tab

Hit "Install from storage" and select microG_Installer_Revived.zip

Reboot

Open "microG Settings" from App launcher and check if all checkmarks are set

Have fun!​