I finally managed to find a working fix for this issue after having found this post. The origin of the problem is TWRP:
Fix
You have at least two solutions to fix this issue:
I haven't tested it, but dirty flashing a ROM (without a factory reset) might also work. But this usually leads to some random ****ups.
Also the TWRP alternative "Orange Fox" was mentioned as a solution in this thread. I actually can't remember if I've used Orange Fox to factory reset my phone or if I've flashed it only after having performed a factory reset using TWRP. For me Orange Fox didn't work (= encryption didn't work). But you might give it a try...
Original post
Formatting /data in TWRP uses up all the blocks, but encryption from Lineage needs 16kb of free space at the end of the partition to store the headers.
Fix
You have at least two solutions to fix this issue:
- Resize your /data partition to free up the needed space. Here and here are guides how to do it. I haven't give it a try, so I can't confirm it's working, but several other guys reported this fix working.
- If you're not comfortable to resize your partition, you can use an old version of TWRP. Beginning with version 3.2.0.0 TWRP seems to use up all blocks for /data. So you need a version prior to this one. I've used TWRP 3.1.0.0, but 3.1.1.0 should also work. Step by step:
- Download and flash TWRP 3.1.0.0.
- Boot into recovery and do a factory reset: Main menu -> Wipe -> Format Data (confirm with "yes"). I also wiped Cache and System (Main menu -> Wipe -> Advanced Wipe).
- If you're going to flash a Nougat based ROM you can stop reading and start flashing and encrypting
- If you're going to flash an Oreo based ROM you now need to update your TWRP version as anything prior to 3.2.0.0 doesn't support flashing Android 8.1. The official TWPR version sucks because you won't be able to decrypt your phone when booting in recovery. I've used the TWRP provided in this post.
- Install your preferred ROM and encrypt it.
I haven't tested it, but dirty flashing a ROM (without a factory reset) might also work. But this usually leads to some random ****ups.
Also the TWRP alternative "Orange Fox" was mentioned as a solution in this thread. I actually can't remember if I've used Orange Fox to factory reset my phone or if I've flashed it only after having performed a factory reset using TWRP. For me Orange Fox didn't work (= encryption didn't work). But you might give it a try...
Original post
Hi guys,
I'm kind of stuck right now because I cannot encrypt my phone anymore and I don't know why. I got my phone last year and installed LOS 14.1 right away. For security reasons I also encrypted it - without any issues whatsoever. When LOS 15.1 came out, I upgraded my phone, with encryption still working. A couple of days back for some reason I decided to do a factory reset. Obviously, the device wasn't encrypted anymore after the reset. I then installed the new nightly of LOS (20180807) and tried to encrypt my phone once again. When I select "Encrypt phone", I need to enter my PIN, the phone restarts and reboots without encryption being started.
What I've done so far:
Nothing helped. The phone just reboots and stays unencrypted.
- I've flashed two different TWRP versions: 3.2.3.0 and a customized one (https://forum.xda-developers.com/re...other-development/rom-lineageos-15-0-t3690465).
- I've clean installed different LOS versions (unofficial LOS 14.1 and LOS 15.1 starting from the 20180710 release)
- I've clean installed Omnirom (current release and a release from 20180107).
- I've even flashed MIUI 9 and reinstalled LOS thereafter because some guy in the above mentioned LOS thread wrote, that this did the trick for him.
- I've disabled WI-FI and mobile data before trying to encrypt my phone, because I found a blog article stating that this might help.
Do you guys have any additional hints or ideas how I can manage to encrypt my phone once again? Could another TWRP version do the trick? Is TWRP even involved in any kind when it comes to encryption of the OS? Do you think another ROM could be helpful?
Last edited: