Android: Full-Disk Encryption
I had some problems to encrypt my FP2. Cause was that this FP2 was already encrypted before. It seems a LUKS header problem. So this was my solution:
Boot into TWRP
recovery and drop a root shell:
ls -1 /dev/block/platform/*/by-name/userdata /dev/block/platform/xyz/by-name/userdata dd if=/dev/zero of=/dev/block/platform/xyz/by-name/userdata bs=1M
This overwrite very block of the userdata partition with zeros and consumes a lot of time (my last try was 10 minutes)! Be careful with this.
Boot into bootloader (fastboot) mode and re-create your userdata partition:
fastboot erase userdata fastboot format userdata
Boot normal into your FP2 and start encryption again (at Settings -> Security).
Check also this topic: Encrypt phone with FairPhone OpenSoure OperatingSystem
- Faster with resize2fs command: Check Encrypt phone with FairPhone Open OS